Tariffazione con i GLM

Statistica Assicurativa

Leonardo Stincone, 10/02/2020

/* Percorso in cui si trovano i dati */ libname dati '/folders/myfolders/data'; /* Parametri grafici */ ods graphics on / width = 10cm height = 8cm; /* Carico il dataset con le polizze */ data polizze; set dati.polizze; run; data polizze; set polizze; freqsin = nsin / espo; run; /* Creo un dataset con le sole polizze sinistrate */ data polizze_sin; set polizze; where nsin > 0; dannomedio = dannotot / nsin; run; proc print data = polizze (obs=10) round; run;
SAS Connection established. Subprocess id is 2476
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf espo nsin dannotot freqsin
1 F 35 MI NO B 18 620 10 1.0 0 0.00 0
2 M 37 AP NO B 37 790 12 1.0 0 0.00 0
3 M 45 LE NO B 63 850 15 1.0 0 0.00 0
4 F 21 PS NO B 34 710 13 1.0 0 0.00 0
5 M 48 SP NO B 33 770 12 0.2 0 0.00 0
6 F 45 TO NO B 44 780 14 1.0 0 0.00 0
7 M 35 PG NO D 51 1035 19 1.0 0 0.00 0
8 M 70 PG SI B 65 970 15 1.0 0 0.00 0
9 F 46 AR NO B 61 820 15 1.0 0 0.00 0
10 M 55 AR NO B 80 1180 18 1.0 1 359.06 1

1) Analisi preliminari

proc means data = polizze nway noprint; var espo nsin dannotot; output out = polizzeMeans sum = totespo totnsin totdannotot; run; data polizzeMeans; set polizzeMeans; totfreqsin = totnsin / totespo; if totnsin > 0 then totdannomed = totdannotot / totnsin; else totdannomed=0; totqd = totdannotot / totespo; drop _TYPE_; rename _FREQ_ = totnpol; format totfreqsin 5.3; format totespo 10.2; format totdannotot 10.2; format totqd 10.2; run; proc print data = polizzeMeans noobs round; var totfreqsin totdannomed totqd totespo; run;
SAS Output
totfreqsin totdannomed totqd totespo
0.103 3000 308.83 123282.32
proc means data = polizze maxdec = 2; var eta potf potkil massa; weight espo; run;
SAS Output

The MEANS Procedure

Variable Label N Mean Std Dev Minimum Maximum
Eta
potf
Potkil
Massa
Eta
 
Potkil
Massa
172161
172161
172161
172161
42.64
14.85
51.54
920.92
12.20
2.66
19.79
169.66
18.00
8.00
17.00
555.00
95.00
41.00
362.00
2240.00

1. Sesso

proc means data = polizze nway noprint; class sesso; var espo nsin dannotot; output out = polizzebysesso sum = totespo totnsin totdannotot; run; data polizzebysesso; set polizzebysesso; totfreqsin = totnsin / totespo; if totnsin > 0 then totdannomed = totdannotot / totnsin; else totdannomed=0; totqd = totdannotot / totespo; drop _TYPE_; rename _FREQ_ = totnpol; format totfreqsin 5.3; format totespo 10.2; format totdannotot 10.2; format totqd 10.2; run; proc print data = polizzebysesso noobs; var sesso totfreqsin totdannomed totqd totespo; run;
SAS Output
Sesso totfreqsin totdannomed totqd totespo
F 0.098 2758.37 269.97 39735.73
M 0.105 3106.76 327.31 83546.59
proc sgplot data=polizze; vline sesso / response=freqsin weight=espo stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure
proc sgplot data=polizze_sin; vline sesso / response=dannomedio weight=nsin stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure

2. Capoluogo

proc means data = polizze nway noprint; class capoluogo; var espo nsin dannotot; output out = polizzebycapoluogo sum = totespo totnsin totdannotot; run; data polizzebycapoluogo; set polizzebycapoluogo; totfreqsin = totnsin / totespo; if totnsin > 0 then totdannomed = totdannotot / totnsin; else totdannomed=0; totqd = totdannotot / totespo; drop _TYPE_; rename _FREQ_ = totnpol; format totfreqsin 5.3; format totespo 10.2; format totdannotot 10.2; format totqd 10.2; run; proc print data=polizzebycapoluogo noobs; var capoluogo totfreqsin totdannomed totqd totespo; run;
SAS Output
Capoluogo totfreqsin totdannomed totqd totespo
NO 0.097 3117.84 301.35 101269.74
SI 0.132 2602.67 343.24 22012.58
proc sgplot data=polizze; vline capoluogo / response=freqsin weight=espo stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure
proc sgplot data=polizze_sin; vline capoluogo / response=dannomedio weight=nsin stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure

3. Bendie

proc means data = polizze nway noprint; class bendie; var espo nsin dannotot; output out=polizzebybendie sum=totespo totnsin totdannotot; run; data polizzebybendie; set polizzebybendie; totfreqsin = totnsin / totespo; if totnsin > 0 then totdannomed = totdannotot / totnsin; else totdannomed=0; totqd = totdannotot / totespo; drop _TYPE_; rename _FREQ_ = totnpol; format totfreqsin 5.3; format totespo 10.2; format totdannotot 10.2; format totqd 10.2; run; proc print data = polizzebybendie noobs; var bendie totfreqsin totdannomed totqd totespo; run;
SAS Output
Bendie totfreqsin totdannomed totqd totespo
B 0.099 3044.79 300.60 114456.64
D 0.158 2636.14 415.48 8825.68
proc sgplot data=polizze; vline bendie / response=freqsin weight=espo stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure
proc sgplot data=polizze_sin; vline bendie / response=dannomedio weight=nsin stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure

4. Prov

proc means data = polizze nway noprint; class prov; var espo nsin dannotot; output out = polizzebyprov sum = totespo totnsin totdannotot; run; data polizzebyprov; set polizzebyprov; totfreqsin = totnsin / totespo; if totnsin > 0 then totdannomed = totdannotot / totnsin; else totdannomed=0; totqd = totdannotot / totespo; drop _TYPE_; rename _FREQ_ = totnpol; format totfreqsin 5.3; format totespo 10.2; format totdannotot 10.2; format totqd 10.2; run; proc sort data = polizzebyprov; by descending totfreqsin; run; proc print data = polizzebyprov (obs = 10); var prov totfreqsin totdannomed totqd totespo; run;
SAS Output
Obs Prov totfreqsin totdannomed totqd totespo
1 KR 0.247 3052.88 753.71 8.10
2 NA 0.166 2255.60 374.41 2138.67
3 AO 0.165 1607.49 265.26 145.44
4 CE 0.162 1999.70 323.63 1211.09
5 ROMA 0.146 2239.97 326.51 617.43
6 CA 0.145 2485.66 359.45 567.04
7 SP 0.142 3161.38 449.80 611.48
8 PT 0.142 3019.11 427.32 847.82
9 TA 0.141 1735.74 244.96 524.35
10 PA 0.140 2130.07 298.28 692.70
/* Parametri grafici */ ods graphics on / width = 16cm height = 10cm; proc sgplot data=polizze; vline prov / response=freqsin weight=espo stat=mean limitstat=clm alpha = .05 categoryorder=respdesc; yaxis min = 0.05 max = 0.25; run;
SAS Output
The SGPlot Procedure

5. eta

proc means data = polizze nway noprint; class eta; var espo nsin dannotot; output out = polizzebyeta sum = totespo totnsin totdannotot; run; data polizzebyeta; set polizzebyeta; totfreqsin = totnsin / totespo; if totnsin > 0 then totdannomed = totdannotot / totnsin; else totdannomed=0; totqd = totdannotot / totespo; drop _TYPE_; rename _FREQ_ = totnpol; format totfreqsin 5.3; format totespo 10.2; format totdannotot 10.2; format totqd 10.2; run; proc print data = polizzebyeta (obs=10) noobs; var eta totfreqsin totdannomed totqd totespo; run;
SAS Output
Eta totfreqsin totdannomed totqd totespo
18 0.253 2816.35 711.71 91.01
19 0.190 6995.11 1332.43 593.24
20 0.208 3387.97 703.64 1266.33
21 0.158 3988.27 629.14 1939.81
22 0.174 2767.00 482.41 2156.65
23 0.141 4512.06 636.44 2566.41
24 0.144 2912.02 417.98 2724.07
25 0.129 3168.98 408.31 2832.83
26 0.129 3389.06 437.45 2974.93
27 0.108 2897.50 313.58 3132.37
proc sgplot data=polizze; vline eta / response=freqsin weight=espo stat=mean limitstat=clm alpha = .05; yaxis min = 0.05 max = 0.30; run;
SAS Output
The SGPlot Procedure
proc sgplot data=polizze_sin; vline eta / response=dannomedio weight=nsin stat=mean limitstat=clm alpha = .05; yaxis min = 0 max = 8000; run;
SAS Output
The SGPlot Procedure

2) Cluster Analysis

2.1. Prov

proc cluster method = ward data = polizzebyprov outtree = clusterprov print = 5; id prov; var totfreqsin; freq totespo; copy totespo totnsin totdannotot totdannomed; run;
SAS Output

The CLUSTER Procedure

Ward's Minimum Variance Cluster Analysis

Eigenvalues of the Covariance Matrix
  Eigenvalue Difference Proportion Cumulative
1 0.00040350   1.0000 1.0000
Root-Mean-Square Total-Sample Standard Deviation 0.020087
Root-Mean-Square Distance Between Observations 0.028408
Cluster History
Number
of
Clusters
Clusters Joined Freq Semipartial
R-Square
R-Square Tie
5 CL16 CL10 9515 0.0285 .917  
4 CL11 CL8 52015 0.0528 .864  
3 CL6 CL7 61702 0.0656 .798  
2 CL5 CL4 61530 0.2080 .590  
1 CL2 CL3 123232 0.5902 .000  
Horizontal Dendrogram of Cluster Analysis Results
/* clusterprov contiene una riga per ogni passo della procedura di clustering */ proc print data = clusterprov (obs = 10); run;
SAS Output
Obs _NAME_ _PARENT_ _NCL_ _FREQ_ _HEIGHT_ _RMSSTD_ _SPRSQ_ _RSQ_ _PSF_ _PST2_ _ERSQ_ _RATIO_ _LOGR_ _CCC_ totfreqsin _DIST_ _AVLINK_ Prov totespo totnsin totdannotot totdannomed
1 RSM   103 0 0 0 0 1 . . . . . . 0.000 0 0 RSM 0.04 0 0.00 0.00
2 VT CL102 103 944 0 0 0 1 . . . . . . 0.090 0 0 VT 944.67 85 157469.91 1852.59
3 RC CL102 103 355 0 0 0 1 . . . . . . 0.090 0 0 RC 355.66 32 68799.84 2150.00
4 BN CL101 103 60 0 0 0 1 . . . . . . 0.132 0 0 BN 60.39 8 13033.78 1629.22
5 PO CL101 103 67 0 0 0 1 . . . . . . 0.132 0 0 PO 67.96 9 24085.55 2676.17
6 OR CL100 103 186 0 0 0 1 . . . . . . 0.091 0 0 OR 186.91 17 156203.33 9188.43
7 CN CL100 103 1154 0 0 0 1 . . . . . . 0.091 0 0 CN 1154.79 105 277702.80 2644.79
8 VC CL99 103 1644 0 0 0 1 . . . . . . 0.094 0 0 VC 1644.71 154 295996.92 1922.06
9 RA CL99 103 1303 0 0 0 1 . . . . . . 0.094 0 0 RA 1303.27 122 692249.43 5674.18
10 EN CL98 103 124 0 0 0 1 . . . . . . 0.097 0 0 EN 124.29 12 15241.08 1270.09

Con 12 cluster arrivo a $R^2 ≥ 0.99$

proc tree data = clusterprov nclusters = 12 out = prov12cl noprint; id prov; copy totespo totnsin totdannotot totfreqsin totdannomed; run; /* Assegno San Marino al cluster 12, che è quello con la frequenza sinistri più bassa */ data prov12cl; set prov12cl; if prov='RSM' then cluster=12; run; /* prov12cl contiene tante righe quante sono le province e indica di ogni provincia a quale cluster appartiene */ proc print data = prov12cl (obs = 10); run;
SAS Output
Obs Prov totespo totnsin totdannotot totfreqsin totdannomed CLUSTER CLUSNAME
1 RSM 0.04 0 0.00 0.000 0.00 12  
2 VT 944.67 85 157469.91 0.090 1852.59 1 CL14
3 RC 355.66 32 68799.84 0.090 2150.00 1 CL14
4 BN 60.39 8 13033.78 0.132 1629.22 2 CL26
5 PO 67.96 9 24085.55 0.132 2676.17 2 CL26
6 OR 186.91 17 156203.33 0.091 9188.43 1 CL14
7 CN 1154.79 105 277702.80 0.091 2644.79 1 CL14
8 VC 1644.71 154 295996.92 0.094 1922.06 1 CL14
9 RA 1303.27 122 692249.43 0.094 5674.18 1 CL14
10 EN 124.29 12 15241.08 0.097 1270.09 3 CL20
/* polizzebyclusterprov contiene una riga per ogni cluster e indica di ogni cluster una serie di informazioni */ proc means data = prov12cl nway noprint; class cluster; var totespo totnsin totdannotot; output out = polizzebyclusterprov sum = totespocl totnsincl totdannototcl; run; data polizzebyclusterprov; set polizzebyclusterprov; totfreqsincl = totnsincl / totespocl; if totnsincl > 0 then totdannomedcl = totdannototcl / totnsincl; else totdannomedcl = 0; totqdcl = totdannototcl / totespocl; drop _type_; rename _FREQ_ = numprov; format totfreqsincl 5.3; format totespocl 10.2; format totdannototcl 10.2; format totqdcl 10.2; run; proc print data = polizzebyclusterprov; run;
SAS Output
Obs CLUSTER numprov totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 1 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
2 2 4 2158.09 289 537774.02 0.134 1860.81 249.19
3 3 12 12480.92 1215 3369680.21 0.097 2773.40 269.99
4 4 10 18644.35 1567 5068192.03 0.084 3234.33 271.84
5 5 15 15491.65 1603 5149935.33 0.103 3212.69 332.43
6 6 9 12556.48 1378 4973336.43 0.110 3609.10 396.08
7 7 7 6464.18 758 2128488.68 0.117 2808.03 329.27
8 8 6 17521.58 2133 5941180.86 0.122 2785.36 339.08
9 9 6 3860.83 550 1377816.14 0.142 2505.12 356.87
10 10 8 7454.64 540 1906127.50 0.072 3529.87 255.70
11 11 4 3503.31 577 1237363.06 0.165 2144.48 353.20
12 12 4 1415.91 79 401864.78 0.056 5086.90 283.82
proc sort data = prov12cl; by cluster; run; /* Arricchisco il dataset prov12cl con le informazioni dei cluster a cui ogni provincia appartiene appartengono */ data prov12cl; merge prov12cl polizzebyclusterprov; by cluster; run; proc print data = prov12cl (obs = 10); run;
SAS Output
Obs Prov totespo totnsin totdannotot totfreqsin totdannomed CLUSTER CLUSNAME numprov totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 VT 944.67 85 157469.91 0.090 1852.59 1 CL14 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
2 RC 355.66 32 68799.84 0.090 2150.00 1 CL14 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
3 OR 186.91 17 156203.33 0.091 9188.43 1 CL14 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
4 CN 1154.79 105 277702.80 0.091 2644.79 1 CL14 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
5 VC 1644.71 154 295996.92 0.094 1922.06 1 CL14 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
6 RA 1303.27 122 692249.43 0.094 5674.18 1 CL14 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
7 LC 119.11 11 24287.52 0.092 2207.96 1 CL14 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
8 FE 964.48 89 207535.55 0.092 2331.86 1 CL14 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
9 SS 531.54 47 169022.57 0.088 3596.22 1 CL14 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
10 VV 11.36 1 1580.75 0.088 1580.75 1 CL14 19 21730.39 2002 5981240.95 0.092 2987.63 275.25
proc sgplot data = prov12cl; scatter x = totfreqsin y = totdannomed / group = cluster markerattrs=(symbol=CircleFilled); run;
SAS Output
The SGPlot Procedure

2.2. eta

proc means data = polizze nway noprint; class eta; var espo nsin dannotot; output out = polizzebyeta sum = totespo totnsin totdannotot; run; data polizzebyeta; set polizzebyeta; totfreqsin = totnsin/totespo; if totnsin>0 then totdannomed = totdannotot/totnsin; else totdannomed = 0; totqd = totdannotot / totespo; drop _TYPE_; rename _FREQ_ = totnpol; run; proc print data = polizzebyeta (obs = 10) noobs; var eta totfreqsin totdannomed totqd totespo; run;
SAS Output
Eta totfreqsin totdannomed totqd totespo
18 0.25271 2816.35 711.71 91.01
19 0.19048 6995.11 1332.43 593.24
20 0.20769 3387.97 703.64 1266.33
21 0.15775 3988.27 629.14 1939.81
22 0.17434 2767.00 482.41 2156.65
23 0.14105 4512.06 636.44 2566.41
24 0.14353 2912.02 417.98 2724.07
25 0.12885 3168.98 408.31 2832.83
26 0.12908 3389.06 437.45 2974.93
27 0.10822 2897.50 313.58 3132.37
proc sgplot data = polizzebyeta; scatter x = eta y = totfreqsin / markerattrs=(symbol=CircleFilled); series x = eta y = totfreqsin; run;
SAS Output
The SGPlot Procedure
/* Preraggruppamento */ proc format; value formateta low-22 = "18-22" 23-24 = "23-24" 25-26 = "25-26" 27-30 = "27-30" 31-34 = "31-34" 35-43 = "35-43" 44-51 = "44-51" 52-60 = "52-60" 61-64 = "61-64" 65-69 = "65-69" 70-81 = "70-81" 82-high = "82-"; run; data polizzebyeta; set polizzebyeta; leveleta = eta; format leveleta formateta.; run; /* Calcolo le informazioni a livello di ogni gruppo */ proc means data = polizzebyeta nway noprint; class leveleta; var eta totfreqsin; weight totespo; output out = polizzebyleveleta1 mean = etamed totfreqsinmed; run; proc means data = polizzebyeta nway noprint; class leveleta; var totespo totnsin totdannotot totnpol; output out = polizzebyleveleta2 sum = totespo totnsin totdannotot totnpol; run; data polizzebyleveleta; merge polizzebyleveleta1 polizzebyleveleta2; by leveleta; drop _type_ _freq_; run; /* Standardizzo eta e freqsin in modo da poterle usare assieme per l'accorpamento */ proc standard data = polizzebyleveleta out = polizzebyleveletastd mean = 0 std = 1; weight totespo; var etamed totfreqsinmed; run; data polizzebyleveletastd; set polizzebyleveletastd; format etamed 8.4; format totfreqsinmed 8.4; run; data polizzebyleveletastd; set polizzebyleveletastd; rename totfreqsinmed = totfreqsinmedstd; rename etamed = etamedstd; run; data polizzebyleveleta; merge polizzebyleveleta polizzebyleveletastd; by leveleta; run; proc print data = polizzebyleveleta; run;
SAS Output
Obs leveleta etamed totfreqsinmed totespo totnsin totdannotot totnpol etamedstd totfreqsinmedstd
1 18-22 21 0.17877 6047.04 1081 4007061.49 8991 -0.0144 0.0323
2 23-24 24 0.14233 5290.49 753 2771965.77 7542 -0.0127 0.0168
3 25-26 26 0.12897 5807.76 749 2458076.42 8292 -0.0113 0.0111
4 27-30 29 0.10288 13053.90 1343 4436387.56 18671 -0.0093 -0.0000
5 31-34 32 0.09152 12992.03 1189 2940408.97 18382 -0.0067 -0.0049
6 35-43 39 0.08305 25371.75 2107 6632792.66 35267 -0.0025 -0.0085
7 44-51 47 0.10100 20356.78 2056 5287609.56 28264 0.0031 -0.0008
8 52-60 56 0.10451 17873.66 1868 5358383.58 24606 0.0087 0.0007
9 61-64 62 0.09028 5781.94 522 1467871.43 7813 0.0131 -0.0054
10 65-69 67 0.09161 5414.12 496 1130324.59 7296 0.0160 -0.0048
11 70-81 73 0.09878 4899.85 484 1486592.19 6508 0.0203 -0.0018
12 82- 86 0.10941 393.00 43 95525.78 529 0.0284 0.0028
/* Effettuo il clustering usando sia etamedstd che totfreqsinmedstd */ proc cluster method = ward data = polizzebyleveleta outtree = clustereta; id leveleta; var etamedstd totfreqsinmedstd; freq totespo; copy totespo totnsin totdannotot etamed totfreqsinmed; run;
SAS Output

The CLUSTER Procedure

Ward's Minimum Variance Cluster Analysis

Eigenvalues of the Covariance Matrix
  Eigenvalue Difference Proportion Cumulative
1 0.00012676 0.00007507 0.7103 0.7103
2 0.00005169   0.2897 1.0000
Root-Mean-Square Total-Sample Standard Deviation 0.009446
Root-Mean-Square Distance Between Observations 0.018892
Cluster History
Number
of
Clusters
Clusters Joined Freq Semipartial
R-Square
R-Square Tie
11 61-64 65-69 11195 0.0011 .999  
10 70-81 82- 5292 0.0014 .997  
9 23-24 25-26 11097 0.0043 .993  
8 27-30 31-34 26045 0.0089 .984  
7 CL11 CL10 16487 0.0090 .975  
6 44-51 52-60 38229 0.0145 .961  
5 CL8 35-43 51416 0.0394 .921  
4 18-22 CL9 17144 0.0621 .859  
3 CL6 CL7 54716 0.0694 .790  
2 CL5 CL3 106132 0.2665 .523  
1 CL4 CL2 123276 0.5234 .000  
Horizontal Dendrogram of Cluster Analysis Results

Con 9 cluster arrivo a $R^2 ≥ 0.99$

proc tree data = clustereta nclusters = 9 out = cluster9eta noprint; id leveleta; copy totespo totnsin totdannotot etamed totfreqsinmed; run; /* cluster9eta contiene tante righe quanti erano i cluster nel preraggruppamento manuale */ proc print data = cluster9eta; run;
SAS Output
Obs leveleta totespo totnsin totdannotot etamed totfreqsinmed CLUSTER CLUSNAME
1 61-64 5781.94 522 1467871.43 62 0.09028 1 CL11
2 65-69 5414.12 496 1130324.59 67 0.09161 1 CL11
3 70-81 4899.85 484 1486592.19 73 0.09878 2 CL10
4 82- 393.00 43 95525.78 86 0.10941 2 CL10
5 23-24 5290.49 753 2771965.77 24 0.14233 3 CL9
6 25-26 5807.76 749 2458076.42 26 0.12897 3 CL9
7 27-30 13053.90 1343 4436387.56 29 0.10288 4 27-30
8 31-34 12992.03 1189 2940408.97 32 0.09152 5 31-34
9 44-51 20356.78 2056 5287609.56 47 0.10100 6 44-51
10 52-60 17873.66 1868 5358383.58 56 0.10451 7 52-60
11 35-43 25371.75 2107 6632792.66 39 0.08305 8 35-43
12 18-22 6047.04 1081 4007061.49 21 0.17877 9 18-22
/* polizzebyclustereta contiene una riga per ogni cluster e indica di ogni cluster una serie di informazioni */ proc means data = cluster9eta nway noprint; class cluster; var totespo totnsin totdannotot; output out = polizzebyclustereta sum = totespocl totnsincl totdannototcl; run; data polizzebyclustereta; set polizzebyclustereta; totfreqsincl = totnsincl/totespocl; if totnsincl>0 then totdannomedcl = totdannototcl/totnsincl; else totdannomedcl = 0; totqdcl = totdannototcl / totespocl; drop _type_; format totfreqsincl 5.3; format totespocl 10.2; format totdannototcl 10.2; format totqdcl 10.2; run; proc print data = polizzebyclustereta; run;
SAS Output
Obs CLUSTER _FREQ_ totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 1 2 11196.06 1018 2598196.02 0.091 2552.26 232.06
2 2 2 5292.85 527 1582117.97 0.100 3002.12 298.92
3 3 2 11098.25 1502 5230042.20 0.135 3482.05 471.25
4 4 1 13053.90 1343 4436387.56 0.103 3303.34 339.85
5 5 1 12992.03 1189 2940408.97 0.092 2473.01 226.32
6 6 1 20356.78 2056 5287609.56 0.101 2571.79 259.75
7 7 1 17873.66 1868 5358383.58 0.105 2868.51 299.79
8 8 1 25371.75 2107 6632792.66 0.083 3147.98 261.42
9 9 1 6047.04 1081 4007061.49 0.179 3706.81 662.65
proc sort data = cluster9eta; by cluster; run; /* Arricchisco il dataset cluster9eta con le informazioni dei cluster a cui ogni gruppo appartiene appartengono */ data cluster9eta; merge cluster9eta polizzebyclustereta; by cluster; run; proc print data = cluster9eta; run;
SAS Output
Obs leveleta totespo totnsin totdannotot etamed totfreqsinmed CLUSTER CLUSNAME _FREQ_ totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 61-64 5781.94 522 1467871.43 62 0.09028 1 CL11 2 11196.06 1018 2598196.02 0.091 2552.26 232.06
2 65-69 5414.12 496 1130324.59 67 0.09161 1 CL11 2 11196.06 1018 2598196.02 0.091 2552.26 232.06
3 70-81 4899.85 484 1486592.19 73 0.09878 2 CL10 2 5292.85 527 1582117.97 0.100 3002.12 298.92
4 82- 393.00 43 95525.78 86 0.10941 2 CL10 2 5292.85 527 1582117.97 0.100 3002.12 298.92
5 23-24 5290.49 753 2771965.77 24 0.14233 3 CL9 2 11098.25 1502 5230042.20 0.135 3482.05 471.25
6 25-26 5807.76 749 2458076.42 26 0.12897 3 CL9 2 11098.25 1502 5230042.20 0.135 3482.05 471.25
7 27-30 13053.90 1343 4436387.56 29 0.10288 4 27-30 1 13053.90 1343 4436387.56 0.103 3303.34 339.85
8 31-34 12992.03 1189 2940408.97 32 0.09152 5 31-34 1 12992.03 1189 2940408.97 0.092 2473.01 226.32
9 44-51 20356.78 2056 5287609.56 47 0.10100 6 44-51 1 20356.78 2056 5287609.56 0.101 2571.79 259.75
10 52-60 17873.66 1868 5358383.58 56 0.10451 7 52-60 1 17873.66 1868 5358383.58 0.105 2868.51 299.79
11 35-43 25371.75 2107 6632792.66 39 0.08305 8 35-43 1 25371.75 2107 6632792.66 0.083 3147.98 261.42
12 18-22 6047.04 1081 4007061.49 21 0.17877 9 18-22 1 6047.04 1081 4007061.49 0.179 3706.81 662.65

2.3 potf

proc means data = polizze nway noprint; class potf; var espo nsin dannotot; output out=polizzebypotf sum=totespo totnsin totdannotot; run; data polizzebypotf; set polizzebypotf; totfreqsin = totnsin / totespo; if totnsin > 0 then totdannomed = totdannotot / totnsin; else totdannomed = 0; totqd = totdannotot / totespo; drop _TYPE_; rename _FREQ_ = totnpol; run; proc print data = polizzebypotf (obs = 10) noobs; var potf totfreqsin totdannomed totqd totespo; run;
SAS Output
potf totfreqsin totdannomed totqd totespo
8 0.05539 1944.00 107.686 108.32
9 0.07350 2652.59 194.962 462.59
10 0.08866 2521.23 223.520 8798.13
11 0.07610 1693.54 128.886 604.43
12 0.08950 2387.18 213.641 23710.77
13 0.09886 2865.89 283.325 18773.85
14 0.10245 3726.90 381.824 9985.27
15 0.11341 2712.68 307.646 14425.51
16 0.09970 3201.22 319.150 6319.19
17 0.10883 3172.22 345.247 13543.50
proc sgplot data = polizzebypotf; scatter x = potf y = totfreqsin / markerattrs=(symbol=CircleFilled); series x = potf y = totfreqsin; run;
SAS Output
The SGPlot Procedure
/* Preraggruppamento */ proc format; value formatpotf low-13 = "8-13" 14-15 = "14-15" 16 = "16" 17-21 = "17-21" 22-23 = "22-23" 24-26 = "24-26" 27-28 = "27-28" 29-30 = "29-30" 31-high = "31-"; run; data polizzebypotf; set polizzebypotf; levelpotf = potf; format levelpotf formatpotf.; run; /* Calcolo le informazioni a livello di ogni gruppo */ proc means data = polizzebypotf nway noprint; class levelpotf; var potf totfreqsin; weight totespo; output out = polizzebylevelpotf1 mean = potfmed totfreqsinmed; run; proc means data = polizzebypotf nway noprint; class levelpotf; var totespo totnsin totdannotot totnpol; output out = polizzebylevelpotf2 sum = totespo totnsin totdannotot totnpol; run; data polizzebylevelpotf; merge polizzebylevelpotf1 polizzebylevelpotf2; by levelpotf; drop _type_ _freq_; run; /* Standardizzo potf e freqsin in modo da poterle usare assieme per l'accorpamento */ proc standard data = polizzebylevelpotf out = polizzebylevelpotfstd mean = 0 std = 1; weight totespo; var potfmed totfreqsinmed; run; data polizzebylevelpotfstd; set polizzebylevelpotfstd; format potfmed 8.4; format totfreqsinmed 8.4; run; data polizzebylevelpotfstd; set polizzebylevelpotfstd; rename totfreqsinmed = totfreqsinmedstd; rename potfmed = potfmedstd; run; data polizzebylevelpotf; merge polizzebylevelpotf polizzebylevelpotfstd; by levelpotf; run; proc print data = polizzebylevelpotf; run;
SAS Output
Obs levelpotf potfmed totfreqsinmed totespo totnsin totdannotot totnpol potfmedstd totfreqsinmedstd
1 8-13 11.9762 0.09234 52458.09 4844 12530996.69 69752 -0.0078 -0.0072
2 14-15 14.5909 0.10893 24410.77 2659 8250561.58 33959 -0.0007 0.0040
3 16 16.0000 0.09970 6319.19 630 2016770.78 8812 0.0031 -0.0022
4 17-21 18.2424 0.11131 37795.14 4207 14159780.22 55913 0.0092 0.0057
5 22-23 22.8791 0.16838 1829.25 308 880999.10 2911 0.0217 0.0442
6 24-26 25.7794 0.10898 211.05 23 153340.75 350 0.0295 0.0041
7 27-28 27.5069 0.07383 40.63 3 32992.87 74 0.0342 -0.0197
8 29-30 29.5077 0.07867 114.40 9 31938.14 203 0.0396 -0.0164
9 31- 35.2581 0.07708 103.79 8 15619.88 187 0.0552 -0.0175
/* Effettuo il clustering usando sia potfmedstd che totfreqsinmedstd */ proc cluster method = ward data = polizzebylevelpotf outtree = clusterpotf; id levelpotf; var potfmedstd totfreqsinmedstd; freq totespo; copy totespo totnsin totdannotot potfmed totfreqsinmed; run;
SAS Output

The CLUSTER Procedure

Ward's Minimum Variance Cluster Analysis

Eigenvalues of the Covariance Matrix
  Eigenvalue Difference Proportion Cumulative
1 0.00011638 0.00010301 0.8970 0.8970
2 0.00001337   0.1030 1.0000
Root-Mean-Square Total-Sample Standard Deviation 0.008054
Root-Mean-Square Distance Between Observations 0.016109
Cluster History
Number
of
Clusters
Clusters Joined Freq Semipartial
R-Square
R-Square Tie
8 27-28 29-30 154 0.0001 1.00  
7 CL8 31- 257 0.0011 .999  
6 24-26 CL7 468 0.0051 .994  
5 14-15 16 30729 0.0168 .977  
4 17-21 CL6 38263 0.0292 .948  
3 CL5 CL4 68992 0.1028 .845  
2 CL3 22-23 70821 0.2078 .637  
1 8-13 CL2 123279 0.6371 .000  
Horizontal Dendrogram of Cluster Analysis Results

Con 6 cluster arrivo a $R^2 ≥ 0.99$

proc tree data = clusterpotf nclusters = 6 out = cluster6potf noprint; id levelpotf; copy totespo totnsin totdannotot potfmed totfreqsinmed; run; /* cluster6potf contiene tante righe quanti erano i cluster nel preraggruppamento manuale */ proc print data = cluster9eta; run;
SAS Output
Obs leveleta totespo totnsin totdannotot etamed totfreqsinmed CLUSTER CLUSNAME _FREQ_ totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 61-64 5781.94 522 1467871.43 62 0.09028 1 CL11 2 11196.06 1018 2598196.02 0.091 2552.26 232.06
2 65-69 5414.12 496 1130324.59 67 0.09161 1 CL11 2 11196.06 1018 2598196.02 0.091 2552.26 232.06
3 70-81 4899.85 484 1486592.19 73 0.09878 2 CL10 2 5292.85 527 1582117.97 0.100 3002.12 298.92
4 82- 393.00 43 95525.78 86 0.10941 2 CL10 2 5292.85 527 1582117.97 0.100 3002.12 298.92
5 23-24 5290.49 753 2771965.77 24 0.14233 3 CL9 2 11098.25 1502 5230042.20 0.135 3482.05 471.25
6 25-26 5807.76 749 2458076.42 26 0.12897 3 CL9 2 11098.25 1502 5230042.20 0.135 3482.05 471.25
7 27-30 13053.90 1343 4436387.56 29 0.10288 4 27-30 1 13053.90 1343 4436387.56 0.103 3303.34 339.85
8 31-34 12992.03 1189 2940408.97 32 0.09152 5 31-34 1 12992.03 1189 2940408.97 0.092 2473.01 226.32
9 44-51 20356.78 2056 5287609.56 47 0.10100 6 44-51 1 20356.78 2056 5287609.56 0.101 2571.79 259.75
10 52-60 17873.66 1868 5358383.58 56 0.10451 7 52-60 1 17873.66 1868 5358383.58 0.105 2868.51 299.79
11 35-43 25371.75 2107 6632792.66 39 0.08305 8 35-43 1 25371.75 2107 6632792.66 0.083 3147.98 261.42
12 18-22 6047.04 1081 4007061.49 21 0.17877 9 18-22 1 6047.04 1081 4007061.49 0.179 3706.81 662.65
/* polizzebyclusterpotf contiene una riga per ogni cluster e indica di ogni cluster una serie di informazioni */ proc means data = cluster6potf nway noprint; class cluster; var totespo totnsin totdannotot; output out = polizzebyclusterpotf sum = totespocl totnsincl totdannototcl; run; data polizzebyclusterpotf; set polizzebyclusterpotf; totfreqsincl = totnsincl / totespocl; if totnsincl > 0 then totdannomedcl = totdannototcl / totnsincl; else totdannomedcl = 0; totqdcl = totdannototcl / totespocl; drop _type_; format totfreqsincl 5.3; format totespocl 10.2; format totdannototcl 10.2; format totqdcl 10.2; run; proc print data = polizzebyclusterpotf; run;
SAS Output
Obs CLUSTER _FREQ_ totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 1 4 469.88 43 233891.63 0.092 5439.34 497.77
2 2 1 24410.77 2659 8250561.58 0.109 3102.88 337.99
3 3 1 6319.19 630 2016770.78 0.100 3201.22 319.15
4 4 1 37795.14 4207 14159780.2 0.111 3365.77 374.65
5 5 1 1829.25 308 880999.10 0.168 2860.39 481.62
6 6 1 52458.09 4844 12530996.7 0.092 2586.91 238.88
proc sort data = cluster6potf; by cluster; run; /* Arricchisco il dataset cluster9eta con le informazioni dei cluster a cui ogni gruppo appartiene appartengono */ data cluster6potf; merge cluster6potf polizzebyclusterpotf; by cluster; run; proc print data = cluster6potf; run;
SAS Output
Obs levelpotf totespo totnsin totdannotot potfmed totfreqsinmed CLUSTER CLUSNAME _FREQ_ totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 27-28 40.63 3 32992.87 27.5069 0.07383 1 CL6 4 469.88 43 233891.63 0.092 5439.34 497.77
2 29-30 114.40 9 31938.14 29.5077 0.07867 1 CL6 4 469.88 43 233891.63 0.092 5439.34 497.77
3 31- 103.79 8 15619.88 35.2581 0.07708 1 CL6 4 469.88 43 233891.63 0.092 5439.34 497.77
4 24-26 211.05 23 153340.75 25.7794 0.10898 1 CL6 4 469.88 43 233891.63 0.092 5439.34 497.77
5 14-15 24410.77 2659 8250561.58 14.5909 0.10893 2 14-15 1 24410.77 2659 8250561.58 0.109 3102.88 337.99
6 16 6319.19 630 2016770.78 16.0000 0.09970 3 16 1 6319.19 630 2016770.78 0.100 3201.22 319.15
7 17-21 37795.14 4207 14159780.22 18.2424 0.11131 4 17-21 1 37795.14 4207 14159780.2 0.111 3365.77 374.65
8 22-23 1829.25 308 880999.10 22.8791 0.16838 5 22-23 1 1829.25 308 880999.10 0.168 2860.39 481.62
9 8-13 52458.09 4844 12530996.69 11.9762 0.09234 6 8-13 1 52458.09 4844 12530996.7 0.092 2586.91 238.88

2.4 potkil

proc means data = polizze nway noprint; class potkil; var espo nsin dannotot; output out = polizzebypotkil sum = totespo totnsin totdannotot; run; data polizzebypotkil; set polizzebypotkil; totfreqsin = totnsin / totespo; if totnsin > 0 then totdannomed = totdannotot / totnsin; else totdannomed = 0; totqd = totdannotot / totespo; drop _TYPE_; rename _FREQ_ = totnpol; run; proc print data = polizzebypotkil (obs = 10) noobs; var potkil totfreqsin totdannomed totqd totespo; run;
SAS Output
Potkil totfreqsin totdannomed totqd totespo
17 0.00000 0.00 0.000 1.00
18 0.07744 1962.64 151.979 761.92
21 0.07948 1004.69 79.857 50.32
22 0.06481 2123.15 137.611 1388.58
23 0.06825 2928.59 199.878 424.90
24 0.04795 1232.91 59.115 166.85
25 0.09376 2565.60 240.549 7231.26
26 0.05409 1834.78 99.243 110.93
27 0.14576 1629.22 237.483 54.88
28 0.60132 1617.55 972.671 1.66
proc sgplot data = polizzebypotkil; scatter x = potkil y = totfreqsin / markerattrs=(symbol=CircleFilled); series x = potkil y = totfreqsin; run;
SAS Output
The SGPlot Procedure
/* Preraggruppamento */ proc format; value formatpotkil low-26 = "17-26" 27-33 = "27-33" 34-39 = "34-39" 40-49 = "40-49" 50-57 = "50-57" 58-65 = "58-65" 66-78 = "66-78" 79-92 = "79-92" 93-108 = "93-108" 109-123 = "109-123" 124-139 = "124-139" 140-143 = "140-143" 144-150 = "144-150" 151-high = "151-"; run; data polizzebypotkil; set polizzebypotkil; levelpotkil = potkil; format levelpotkil formatpotkil.; run; /* Calcolo le informazioni a livello di ogni gruppo */ proc means data = polizzebypotkil nway noprint; class levelpotkil; var potkil totfreqsin; weight totespo; output out = polizzebylevelpotkil1 mean = potkilmed totfreqsinmed; run; proc means data = polizzebypotkil nway noprint; class levelpotkil; var totespo totnsin totdannotot totnpol; output out = polizzebylevelpotkil2 sum = totespo totnsin totdannotot totnpol; run; data polizzebylevelpotkil; merge polizzebylevelpotkil1 polizzebylevelpotkil2; by levelpotkil; drop _type_ _freq_; run; /* Standardizzo potkil e freqsin in modo da poterle usare assieme per l'accorpamento */ proc standard data = polizzebylevelpotkil out = polizzebylevelpotkilstd mean = 0 std = 1; weight totespo; var potkilmed totfreqsinmed; run; data polizzebylevelpotkilstd; set polizzebylevelpotkilstd;; format potkilmed 8.4; format totfreqsinmed 8.4; run; data polizzebylevelpotkilstd; set polizzebylevelpotkilstd; rename totfreqsinmed = totfreqsinmedstd; rename potkilmed = potkilmedstd; run; data polizzebylevelpotkil; merge polizzebylevelpotkil polizzebylevelpotkilstd; by levelpotkil; run; proc print data = polizzebylevelpotkil; run;
SAS Output
Obs levelpotkil potkilmed totfreqsinmed totespo totnsin totdannotot totnpol potkilmedstd totfreqsinmedstd
1 17-26 24 0.08623 10135.77 874 2156174.24 12869 -0.0122 -0.0182
2 27-33 32 0.09524 25850.67 2462 6016100.65 33836 -0.0085 -0.0084
3 34-39 37 0.09485 8866.64 841 2349060.15 11897 -0.0066 -0.0088
4 40-49 42 0.10566 21947.98 2319 6765891.74 30871 -0.0042 0.0029
5 50-57 54 0.10234 18468.22 1890 6129883.56 26263 0.0011 -0.0007
6 58-65 63 0.11136 8961.77 998 2819251.65 12396 0.0049 0.0091
7 66-78 70 0.11802 13294.86 1569 5232526.19 19805 0.0084 0.0164
8 79-92 84 0.10980 8551.79 939 3712429.07 12715 0.0146 0.0074
9 93-108 100 0.11632 4556.23 530 1947041.86 7146 0.0215 0.0145
10 109-123 113 0.10033 1335.57 134 394231.62 2114 0.0275 -0.0028
11 124-139 133 0.10190 510.29 52 201130.36 827 0.0361 -0.0011
12 140-143 141 0.14247 42.11 6 8233.18 71 0.0397 0.0429
13 144-150 147 0.15611 224.20 35 144582.22 393 0.0422 0.0577
14 151- 176 0.07833 536.23 42 196463.52 958 0.0551 -0.0267
/* Effettuo il clustering usando sia potkilmedstd che totfreqsinmedstd */ proc cluster method = ward data = polizzebylevelpotkil outtree = clusterpotkil; id levelpotkil; var potkilmedstd totfreqsinmedstd; freq totespo; copy totespo totnsin totdannotot potkilmed totfreqsinmed; run;
SAS Output

The CLUSTER Procedure

Ward's Minimum Variance Cluster Analysis

Eigenvalues of the Covariance Matrix
  Eigenvalue Difference Proportion Cumulative
1 0.00017512 0.00013937 0.8305 0.8305
2 0.00003575   0.1695 1.0000
Root-Mean-Square Total-Sample Standard Deviation 0.010268
Root-Mean-Square Distance Between Observations 0.020537
Cluster History
Number
of
Clusters
Clusters Joined Freq Semipartial
R-Square
R-Square Tie
13 140-143 144-150 266 0.0003 1.00  
12 27-33 34-39 34716 0.0010 .999  
11 109-123 124-139 1845 0.0011 .998  
10 79-92 93-108 13107 0.0112 .986  
9 58-65 66-78 22255 0.0132 .973  
8 40-49 50-57 40415 0.0156 .958  
7 CL11 151- 2381 0.0196 .938  
6 CL10 CL13 13373 0.0269 .911  
5 17-26 CL12 44851 0.0337 .877  
4 CL9 CL6 35628 0.0378 .840  
3 CL4 CL7 38009 0.0874 .752  
2 CL5 CL8 85266 0.1589 .593  
1 CL2 CL3 123275 0.5932 .000  
Horizontal Dendrogram of Cluster Analysis Results

Con 11 cluster arrivo a $R^2 ≥ 0.99$

proc tree data = clusterpotkil nclusters = 11 out = cluster11potkil noprint; id levelpotkil; copy totespo totnsin totdannotot potkilmed totfreqsinmed; run; /* cluster11potkil contiene tante righe quanti erano i cluster nel preraggruppamento manuale */ proc print data = cluster11potkil; run;
SAS Output
Obs levelpotkil totespo totnsin totdannotot potkilmed totfreqsinmed CLUSTER CLUSNAME
1 140-143 42.11 6 8233.18 141 0.14247 1 CL13
2 144-150 224.20 35 144582.22 147 0.15611 1 CL13
3 27-33 25850.67 2462 6016100.65 32 0.09524 2 CL12
4 34-39 8866.64 841 2349060.15 37 0.09485 2 CL12
5 109-123 1335.57 134 394231.62 113 0.10033 3 CL11
6 124-139 510.29 52 201130.36 133 0.10190 3 CL11
7 79-92 8551.79 939 3712429.07 84 0.10980 4 79-92
8 93-108 4556.23 530 1947041.86 100 0.11632 5 93-108
9 58-65 8961.77 998 2819251.65 63 0.11136 6 58-65
10 66-78 13294.86 1569 5232526.19 70 0.11802 7 66-78
11 40-49 21947.98 2319 6765891.74 42 0.10566 8 40-49
12 50-57 18468.22 1890 6129883.56 54 0.10234 9 50-57
13 151- 536.23 42 196463.52 176 0.07833 10 151-
14 17-26 10135.77 874 2156174.24 24 0.08623 11 17-26
/* polizzebyclusterpotkil contiene una riga per ogni cluster e indica di ogni cluster una serie di informazioni */ proc means data = cluster11potkil nway noprint; class cluster; var totespo totnsin totdannotot; output out = polizzebyclusterpotkil sum = totespocl totnsincl totdannototcl; run; data polizzebyclusterpotkil; set polizzebyclusterpotkil; totfreqsincl = totnsincl/totespocl; if totnsincl > 0 then totdannomedcl = totdannototcl / totnsincl; else totdannomedcl = 0; totqdcl = totdannototcl / totespocl; drop _type_; format totfreqsincl 5.3; format totespocl 10.2; format totdannototcl 10.2; format totqdcl 10.2; run; proc print data = polizzebyclusterpotkil; run;
SAS Output
Obs CLUSTER _FREQ_ totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 1 2 266.31 41 152815.40 0.154 3727.20 573.82
2 2 2 34717.32 3303 8365160.80 0.095 2532.59 240.95
3 3 2 1845.86 186 595361.98 0.101 3200.87 322.54
4 4 1 8551.79 939 3712429.07 0.110 3953.60 434.11
5 5 1 4556.23 530 1947041.86 0.116 3673.66 427.34
6 6 1 8961.77 998 2819251.65 0.111 2824.90 314.59
7 7 1 13294.86 1569 5232526.19 0.118 3334.94 393.58
8 8 1 21947.98 2319 6765891.74 0.106 2917.59 308.27
9 9 1 18468.22 1890 6129883.56 0.102 3243.32 331.92
10 10 1 536.23 42 196463.52 0.078 4677.70 366.38
11 11 1 10135.77 874 2156174.24 0.086 2467.02 212.73
proc sort data = cluster11potkil; by cluster; run; /* Arricchisco il dataset cluster11potkil con le informazioni dei cluster a cui ogni gruppo appartiene appartengono */ data cluster11potkil; merge cluster11potkil polizzebyclusterpotkil; by cluster; run; proc print data = cluster11potkil; run;
SAS Output
Obs levelpotkil totespo totnsin totdannotot potkilmed totfreqsinmed CLUSTER CLUSNAME _FREQ_ totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 140-143 42.11 6 8233.18 141 0.14247 1 CL13 2 266.31 41 152815.40 0.154 3727.20 573.82
2 144-150 224.20 35 144582.22 147 0.15611 1 CL13 2 266.31 41 152815.40 0.154 3727.20 573.82
3 27-33 25850.67 2462 6016100.65 32 0.09524 2 CL12 2 34717.32 3303 8365160.80 0.095 2532.59 240.95
4 34-39 8866.64 841 2349060.15 37 0.09485 2 CL12 2 34717.32 3303 8365160.80 0.095 2532.59 240.95
5 109-123 1335.57 134 394231.62 113 0.10033 3 CL11 2 1845.86 186 595361.98 0.101 3200.87 322.54
6 124-139 510.29 52 201130.36 133 0.10190 3 CL11 2 1845.86 186 595361.98 0.101 3200.87 322.54
7 79-92 8551.79 939 3712429.07 84 0.10980 4 79-92 1 8551.79 939 3712429.07 0.110 3953.60 434.11
8 93-108 4556.23 530 1947041.86 100 0.11632 5 93-108 1 4556.23 530 1947041.86 0.116 3673.66 427.34
9 58-65 8961.77 998 2819251.65 63 0.11136 6 58-65 1 8961.77 998 2819251.65 0.111 2824.90 314.59
10 66-78 13294.86 1569 5232526.19 70 0.11802 7 66-78 1 13294.86 1569 5232526.19 0.118 3334.94 393.58
11 40-49 21947.98 2319 6765891.74 42 0.10566 8 40-49 1 21947.98 2319 6765891.74 0.106 2917.59 308.27
12 50-57 18468.22 1890 6129883.56 54 0.10234 9 50-57 1 18468.22 1890 6129883.56 0.102 3243.32 331.92
13 151- 536.23 42 196463.52 176 0.07833 10 151- 1 536.23 42 196463.52 0.078 4677.70 366.38
14 17-26 10135.77 874 2156174.24 24 0.08623 11 17-26 1 10135.77 874 2156174.24 0.086 2467.02 212.73

2.5 massa

proc means data = polizze nway noprint; class massa; var espo nsin dannotot; output out = polizzebymassa sum = totespo totnsin totdannotot; run; data polizzebymassa; set polizzebymassa; totfreqsin = totnsin / totespo; if totnsin > 0 then totdannomed = totdannotot / totnsin; else totdannomed = 0; totqd = totdannotot / totespo; drop _TYPE_; rename _FREQ_ = totnpol; run; proc print data = polizzebymassa (obs = 10) noobs; var massa totfreqsin totdannomed totqd totespo; run;
SAS Output
Massa totfreqsin totdannomed totqd totespo
555 0.00000 0.00 0.000 3.293
595 0.08505 1004.69 85.449 47.031
600 0.00000 0.00 0.000 1.000
620 0.07744 1962.64 151.979 761.919
640 0.10040 2535.30 254.545 597.609
645 0.09502 3869.34 367.668 210.480
650 0.06461 2292.56 148.115 386.957
655 0.08441 2658.69 224.424 485.715
660 0.09553 4501.34 430.005 83.745
665 0.16397 1850.27 303.397 12.197
proc sgplot data = polizzebymassa; scatter x = massa y = totfreqsin / markerattrs=(symbol=CircleFilled); series x = massa y = totfreqsin; run;
SAS Output
The SGPlot Procedure
/* Preraggruppamento */ proc format; value formatmassa low-691 = "555-691" 692-720 = "692-720" 721-800 = "721-800" 801-905 = "801-905" 906-980 = "906-980" 981-1030 = "981-1030" 1031-1094 = "1031-1094" 1095-1269 = "1095-1269" 1270-1379 = "1270-1379" 1380-1424 = "1380-1424" 1425-1520 = "1425-1520" 1521-high = "1521-"; run; data polizzebymassa; set polizzebymassa; levelmassa = massa; format levelmassa formatmassa.; run; /* Calcolo le informazioni a livello di ogni gruppo */ proc means data = polizzebymassa nway noprint; class levelmassa; var massa totfreqsin; weight totespo; output out = polizzebylevelmassa1 mean = massamed totfreqsinmed; run; proc means data = polizzebymassa nway noprint; class levelmassa; var totespo totnsin totdannotot totnpol; output out = polizzebylevelmassa2 sum = totespo totnsin totdannotot totnpol; run; data polizzebylevelmassa; merge polizzebylevelmassa1 polizzebylevelmassa2; by levelmassa; drop _type_ _freq_; run; /* Standardizzo massa e freqsin in modo da poterle usare assieme per l'accorpamento */ proc standard data = polizzebylevelmassa out = polizzebylevelmassastd mean = 0 std = 1; weight totespo; var massamed totfreqsinmed; run; data polizzebylevelmassastd; set polizzebylevelmassastd; rename totfreqsinmed = totfreqsinmedstd; rename massamed = massamedstd; run; data polizzebylevelmassa; merge polizzebylevelmassa polizzebylevelmassastd; by levelmassa; run; proc print data = polizzebylevelmassastd; run;
SAS Output
Obs levelmassa massamedstd totfreqsinmedstd totespo totnsin totdannotot totnpol
1 555-691 -0 -0.020622 5521.44 451 1061529.72 7300
2 692-720 -0 -0.012126 16065.77 1453 3658464.65 20597
3 721-800 -0 -0.004167 26549.50 2619 7429810.95 35149
4 801-905 -0 0.006782 19165.92 2107 5922241.99 27196
5 906-980 0 0.011072 12906.82 1476 5335631.45 18596
6 981-1030 0 -0.001131 11711.90 1192 3311423.85 16285
7 1031-1094 0 -0.001358 7287.62 740 1931281.76 10485
8 1095-1269 0 0.004669 16323.80 1759 6695084.72 24090
9 1270-1379 0 0.008103 4483.50 499 1539118.74 7006
10 1380-1424 0 -0.014131 1052.35 93 327804.52 1706
11 1425-1520 0 0.026959 1499.20 196 581444.16 2531
12 1521- 0 0.044047 714.50 106 279163.49 1220
/* Effettuo il clustering usando sia massamedstd che totfreqsinmedstd */ proc cluster method = ward data = polizzebylevelmassa outtree = clustermassa; id levelmassa; var massamedstd totfreqsinmedstd; freq totespo; copy totespo totnsin totdannotot massamed totfreqsinmed; run;
SAS Output

The CLUSTER Procedure

Ward's Minimum Variance Cluster Analysis

Eigenvalues of the Covariance Matrix
  Eigenvalue Difference Proportion Cumulative
1 0.00014846 0.00011849 0.8320 0.8320
2 0.00002998   0.1680 1.0000
Root-Mean-Square Total-Sample Standard Deviation 0.009446
Root-Mean-Square Distance Between Observations 0.018891
Cluster History
Number
of
Clusters
Clusters Joined Freq Semipartial
R-Square
R-Square Tie
11 981-1030 1031-1094 18998 0.0016 .998  
10 1095-1269 1270-1379 20806 0.0083 .990  
9 1425-1520 1521- 2213 0.0108 .979  
8 801-905 906-980 32071 0.0114 .968  
7 555-691 692-720 21586 0.0143 .954  
6 CL10 1380-1424 21858 0.0217 .932  
5 CL11 CL6 40856 0.0490 .883  
4 CL7 721-800 48135 0.0627 .820  
3 CL5 CL9 43069 0.1295 .691  
2 CL8 CL3 75140 0.1453 .545  
1 CL4 CL2 123275 0.5455 .000  
Horizontal Dendrogram of Cluster Analysis Results

Con 10 cluster arrivo a $R^2 ≥ 0.99$

proc tree data = clustermassa nclusters = 10 out = cluster10massa noprint; id levelmassa; copy totespo totnsin totdannotot massamed totfreqsinmed; run; /* cluster10massa contiene tante righe quanti erano i cluster nel preraggruppamento manuale */ proc print data = cluster10massa; run;
SAS Output
Obs levelmassa totespo totnsin totdannotot massamed totfreqsinmed CLUSTER CLUSNAME
1 981-1030 11711.90 1192 3311423.85 1007 0.10178 1 CL11
2 1031-1094 7287.62 740 1931281.76 1065 0.10154 1 CL11
3 1095-1269 16323.80 1759 6695084.72 1171 0.10776 2 CL10
4 1270-1379 4483.50 499 1539118.74 1303 0.11130 2 CL10
5 1425-1520 1499.20 196 581444.16 1459 0.13074 3 1425-1520
6 1521- 714.50 106 279163.49 1757 0.14835 4 1521-
7 801-905 19165.92 2107 5922241.99 860 0.10993 5 801-905
8 906-980 12906.82 1476 5335631.45 939 0.11436 6 906-980
9 555-691 5521.44 451 1061529.72 663 0.08168 7 555-691
10 692-720 16065.77 1453 3658464.65 706 0.09044 8 692-720
11 1380-1424 1052.35 93 327804.52 1404 0.08837 9 1380-1424
12 721-800 26549.50 2619 7429810.95 772 0.09865 10 721-800
/* polizzebyclustereta contiene una riga per ogni cluster e indica di ogni cluster una serie di informazioni */ proc means data = cluster10massa nway noprint; class cluster; var totespo totnsin totdannotot; output out = polizzebyclustermassa sum = totespocl totnsincl totdannototcl; run; data polizzebyclustermassa; set polizzebyclustermassa; totfreqsincl = totnsincl / totespocl; if totnsincl > 0 then totdannomedcl = totdannototcl / totnsincl; else totdannomedcl = 0; totqdcl = totdannototcl / totespocl; drop _type_; format totfreqsincl 5.3; format totespocl 10.2; format totdannototcl 10.2; format totqdcl 10.2; run; proc print data = polizzebyclustermassa; run;
SAS Output
Obs CLUSTER _FREQ_ totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 1 2 18999.52 1932 5242705.61 0.102 2713.62 275.94
2 2 2 20807.30 2258 8234203.46 0.109 3646.68 395.74
3 3 1 1499.20 196 581444.16 0.131 2966.55 387.84
4 4 1 714.50 106 279163.49 0.148 2633.62 390.71
5 5 1 19165.92 2107 5922241.99 0.110 2810.75 309.00
6 6 1 12906.82 1476 5335631.45 0.114 3614.93 413.40
7 7 1 5521.44 451 1061529.72 0.082 2353.72 192.26
8 8 1 16065.77 1453 3658464.65 0.090 2517.87 227.72
9 9 1 1052.35 93 327804.52 0.088 3524.78 311.50
10 10 1 26549.50 2619 7429810.95 0.099 2836.89 279.85
proc sort data = cluster10massa; by cluster; run; /* Arricchisco il dataset cluster9eta con le informazioni dei cluster a cui ogni gruppo appartiene appartengono */ data cluster10massa; merge cluster10massa polizzebyclustermassa; by cluster; run; proc print data = cluster10massa; run;
SAS Output
Obs levelmassa totespo totnsin totdannotot massamed totfreqsinmed CLUSTER CLUSNAME _FREQ_ totespocl totnsincl totdannototcl totfreqsincl totdannomedcl totqdcl
1 981-1030 11711.90 1192 3311423.85 1007 0.10178 1 CL11 2 18999.52 1932 5242705.61 0.102 2713.62 275.94
2 1031-1094 7287.62 740 1931281.76 1065 0.10154 1 CL11 2 18999.52 1932 5242705.61 0.102 2713.62 275.94
3 1095-1269 16323.80 1759 6695084.72 1171 0.10776 2 CL10 2 20807.30 2258 8234203.46 0.109 3646.68 395.74
4 1270-1379 4483.50 499 1539118.74 1303 0.11130 2 CL10 2 20807.30 2258 8234203.46 0.109 3646.68 395.74
5 1425-1520 1499.20 196 581444.16 1459 0.13074 3 1425-1520 1 1499.20 196 581444.16 0.131 2966.55 387.84
6 1521- 714.50 106 279163.49 1757 0.14835 4 1521- 1 714.50 106 279163.49 0.148 2633.62 390.71
7 801-905 19165.92 2107 5922241.99 860 0.10993 5 801-905 1 19165.92 2107 5922241.99 0.110 2810.75 309.00
8 906-980 12906.82 1476 5335631.45 939 0.11436 6 906-980 1 12906.82 1476 5335631.45 0.114 3614.93 413.40
9 555-691 5521.44 451 1061529.72 663 0.08168 7 555-691 1 5521.44 451 1061529.72 0.082 2353.72 192.26
10 692-720 16065.77 1453 3658464.65 706 0.09044 8 692-720 1 16065.77 1453 3658464.65 0.090 2517.87 227.72
11 1380-1424 1052.35 93 327804.52 1404 0.08837 9 1380-1424 1 1052.35 93 327804.52 0.088 3524.78 311.50
12 721-800 26549.50 2619 7429810.95 772 0.09865 10 721-800 1 26549.50 2619 7429810.95 0.099 2836.89 279.85

Assegnazione formati

/* prov */ proc format; value $classprov "RC","VT","CN","OR","RA","VC","FE","LC","SS","VV","BZ","PV","RG","CH","PG","AR","TE","TN","VR" = "prov1" "BN","PO","IM","BA" = "prov2" "EN","NO","SV","VI","MC","MT","RE","BS","RI","AG","AV","PC" = "prov3" "AL","SO","GO","LT","PR","PN","GR","UD","TV","PD" = "prov4" "SI","TR","AP","LO","FG","ME","LU","CZ","FR","CT","VE","BG","IS","MO","TP" = "prov5" "CL","PI","VA","BR","FO","LI","SR","CO","SA" = "prov6" "LE","RN","AN","MS","BO","GE","TS" = "prov7" "CB","FI","NU","PE","TO","MI" = "prov8" "PT","TA","SP","CA","ROMA","PA" = "prov9" "BL","PZ","BI","CR","CS","AT","MN","PS" = "prov10" "AO","NA","CE","KR" = "prov11" "AQ","RSM","VB","RO" = "prov12"; run; /* eta */ proc format; value classeta low-22 = "18-22" 23-26 = "23-26" 27-30 = "27-30" 31-34 = "31-34" 35-43 = "35-43" 44-51 = "44-51" 52-60 = "52-60" 61-69 = "61-69" 70-high = "70-"; run; /* potf */ proc format; value classpotf low-13 = "8-13" 14-15 = "14-15" 16 = "16" 17-21 = "17-21" 22-23 = "22-23" 24-26 = "24-26" 27-28 = "27-28" 29-30 = "29-30" 31-high = "31-"; run; /* potkil */ proc format; value classpotkil low-26 = "17-26" 27-33 = "27-33" 34-39 = "34-39" 40-49 = "40-49" 50-57 = "50-57" 58-65 = "58-65" 66-78 = "66-78" 79-92 = "79-92" 93-108 = "93-108" 109-123 = "109-123" 124-139 = "124-139" 140-143 = "140-143" 144-150 = "144-150" 151-high = "151-"; run; /* massa */ proc format; value classmassa low-691 = "555-691" 692-720 = "692-720" 721-800 = "721-800" 801-905 = "801-905" 906-980 = "906-980" 981-1030 = "981-1030" 1031-1094 = "1031-1094" 1095-1269 = "1095-1269" 1270-1379 = "1270-1379" 1380-1424 = "1380-1424" 1425-1520 = "1425-1520" 1521-high = "1521-"; run; /* Assegno i formati */ data polizze; set polizze; format prov $classprov.; format eta classeta.; format potf classpotf.; format potkil classpotkil.; format massa classmassa.; run; proc print data = polizze (obs = 10); run;
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf espo nsin dannotot freqsin
1 F 35-43 prov8 NO B 17-26 555-691 8-13 1.00000 0 0.000 0
2 M 35-43 prov5 NO B 34-39 721-800 8-13 1.00000 0 0.000 0
3 M 44-51 prov7 NO B 58-65 801-905 14-15 1.00000 0 0.000 0
4 F 18-22 prov10 NO B 34-39 692-720 8-13 1.00000 0 0.000 0
5 M 44-51 prov9 NO B 27-33 721-800 8-13 0.20000 0 0.000 0
6 F 44-51 prov8 NO B 40-49 721-800 14-15 1.00000 0 0.000 0
7 M 35-43 prov1 NO D 50-57 1031-1094 17-21 1.00000 0 0.000 0
8 M 70- prov1 SI B 58-65 906-980 14-15 1.00000 0 0.000 0
9 F 44-51 prov1 NO B 58-65 801-905 14-15 1.00000 0 0.000 0
10 M 52-60 prov1 NO B 79-92 1095-1269 17-21 1.00000 1 359.057 1

Frequenza sinistri nei cluster

/* prov */ proc sgplot data=polizze; vline prov / response=freqsin weight=espo stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure
/* eta */ proc sgplot data=polizze; vline eta / response=freqsin weight=espo stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure
/* potf */ proc sgplot data=polizze; vline potf / response=freqsin weight=espo stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure
/* potkil */ proc sgplot data=polizze; vline potkil / response=freqsin weight=espo stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure
/* massa */ proc sgplot data=polizze; vline massa / response=freqsin weight=espo stat=mean limitstat=clm alpha = .05; run;
SAS Output
The SGPlot Procedure

3) Tariffazione con i GLM

3.A.1 Modelli per il numero di sinistri

Preparazione dei dati

/* Dataset per modelli con dati individuali */ data polizze; set polizze; lnespo = log(espo); freqsin = nsin / espo; run; /* Dataset per modelli con dati raggruppati */ proc means data = polizze nway noprint; class sesso capoluogo bendie prov eta potf potkil massa; var espo nsin dannotot; output out = polizzecum sum = espocum nsincum dannototcum; run; data polizzecum; set polizzecum; lnespocum = log(espocum); freqsincum = nsincum / espocum; run; proc print data = polizzecum (obs = 10); run;
SAS Output
Obs Sesso Capoluogo Bendie Prov Eta potf Potkil Massa _TYPE_ _FREQ_ espocum nsincum dannototcum lnespocum freqsincum
1 F NO B prov3 18-22 8-13 17-26 555-691 255 3 1.6880 0 0.00 0.52354 0.000000
2 F NO B prov3 18-22 8-13 17-26 692-720 255 23 18.9970 1 2019.70 2.94428 0.052640
3 F NO B prov3 18-22 8-13 27-33 555-691 255 4 3.3920 0 0.00 1.22142 0.000000
4 F NO B prov3 18-22 8-13 27-33 692-720 255 30 23.4110 0 0.00 3.15321 0.000000
5 F NO B prov3 18-22 8-13 27-33 721-800 255 64 46.9260 4 3753.05 3.84857 0.085241
6 F NO B prov3 18-22 8-13 27-33 906-980 255 1 0.9230 0 0.00 -0.08013 0.000000
7 F NO B prov3 18-22 8-13 34-39 692-720 255 7 5.6710 0 0.00 1.73537 0.000000
8 F NO B prov3 18-22 8-13 34-39 721-800 255 48 37.7090 3 4314.97 3.62990 0.079557
9 F NO B prov3 18-22 8-13 34-39 801-905 255 4 3.6740 0 0.00 1.30128 0.000000
10 F NO B prov3 18-22 8-13 40-49 721-800 255 19 14.0980 1 394.96 2.64603 0.070932
/* Il dataset polizzecum ha 26 249 righe */ proc summary data = polizzecum; output out = conta_righe; run; proc print data = conta_righe; run;
SAS Output
Obs _TYPE_ _FREQ_
1 0 26249

3.A.1.1 Modello di Poisson

/* Dati individuali, eta */ proc genmod data = polizze; class eta(ref='35-43'); model nsin = eta / dist = poisson offset = lnespo type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZE
Distribution Poisson
Link Function Log
Dependent Variable nsin
Offset Variable lnespo
Number of Observations Read 172161
Number of Observations Used 172161
Class Level Information
Class Levels Values
Eta 9 18-22 23-26 27-30 31-34 44-51 52-60 61-69 70- 35-43
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 17E4 66656.7461 0.3872
Scaled Deviance 17E4 66656.7461 0.3872
Pearson Chi-Square 17E4 211077.4956 1.2261
Scaled Pearson X2 17E4 211077.4956 1.2261
Log Likelihood   -44647.2568  
Full Log Likelihood   -45351.7365  
AIC (smaller is better)   90721.4730  
AICC (smaller is better)   90721.4740  
BIC (smaller is better)   90811.9787  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -2.4884 0.0218 -2.5311 -2.4457 13046.5 <.0001
Eta 18-22 1 0.7667 0.0374 0.6934 0.8400 419.96 <.0001
Eta 23-26 1 0.4884 0.0338 0.4222 0.5546 209.15 <.0001
Eta 27-30 1 0.2142 0.0349 0.1458 0.2826 37.63 <.0001
Eta 31-34 1 0.0971 0.0363 0.0261 0.1682 7.17 0.0074
Eta 44-51 1 0.1957 0.0310 0.1350 0.2565 39.86 <.0001
Eta 52-60 1 0.2299 0.0318 0.1676 0.2922 52.34 <.0001
Eta 61-69 1 0.0906 0.0382 0.0158 0.1655 5.64 0.0176
Eta 70- 1 0.1815 0.0487 0.0860 0.2769 13.88 0.0002
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 8 518.85 <.0001
/* Dati raggruppati, eta */ proc genmod data = polizzecum; class eta(ref='35-43'); model nsincum = eta / dist = poisson offset = lnespocum type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 9 18-22 23-26 27-30 31-34 44-51 52-60 61-69 70- 35-43
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 20367.2147 0.7762
Scaled Deviance 26E3 20367.2147 0.7762
Pearson Chi-Square 26E3 39689.2852 1.5125
Scaled Pearson X2 26E3 39689.2852 1.5125
Log Likelihood   -11513.4125  
Full Log Likelihood   -18243.0724  
AIC (smaller is better)   36504.1449  
AICC (smaller is better)   36504.1517  
BIC (smaller is better)   36577.7233  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -2.4884 0.0218 -2.5311 -2.4457 13046.5 <.0001
Eta 18-22 1 0.7667 0.0374 0.6934 0.8400 419.96 <.0001
Eta 23-26 1 0.4884 0.0338 0.4222 0.5546 209.15 <.0001
Eta 27-30 1 0.2142 0.0349 0.1458 0.2826 37.63 <.0001
Eta 31-34 1 0.0971 0.0363 0.0261 0.1682 7.17 0.0074
Eta 44-51 1 0.1957 0.0310 0.1350 0.2565 39.86 <.0001
Eta 52-60 1 0.2299 0.0318 0.1676 0.2922 52.34 <.0001
Eta 61-69 1 0.0906 0.0382 0.0158 0.1655 5.64 0.0176
Eta 70- 1 0.1815 0.0487 0.0860 0.2769 13.88 0.0002
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 8 518.85 <.0001
proc genmod data = polizzecum; class eta(ref='35-43') potkil(ref='66-78'); model nsincum = eta potkil / dist = poisson offset = lnespocum type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 9 18-22 23-26 27-30 31-34 44-51 52-60 61-69 70- 35-43
Potkil 14 109-123 124-139 140-143 144-150 151- 17-26 27-33 34-39 40-49 50-57 58-65 79-92 93-108 66-78
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 20231.0225 0.7714
Scaled Deviance 26E3 20231.0225 0.7714
Pearson Chi-Square 26E3 38161.8840 1.4551
Scaled Pearson X2 26E3 38161.8840 1.4551
Log Likelihood   -11445.3164  
Full Log Likelihood   -18174.9764  
AIC (smaller is better)   36393.9527  
AICC (smaller is better)   36393.9913  
BIC (smaller is better)   36573.8111  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -2.3308 0.0317 -2.3929 -2.2687 5410.09 <.0001
Eta 18-22 1 0.7993 0.0376 0.7256 0.8731 451.02 <.0001
Eta 23-26 1 0.5031 0.0338 0.4368 0.5694 221.04 <.0001
Eta 27-30 1 0.2200 0.0349 0.1515 0.2885 39.66 <.0001
Eta 31-34 1 0.0980 0.0363 0.0269 0.1691 7.30 0.0069
Eta 44-51 1 0.1947 0.0310 0.1339 0.2555 39.42 <.0001
Eta 52-60 1 0.2362 0.0318 0.1739 0.2985 55.16 <.0001
Eta 61-69 1 0.1113 0.0382 0.0363 0.1862 8.47 0.0036
Eta 70- 1 0.2174 0.0488 0.1217 0.3131 19.82 <.0001
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil 109-123 1 -0.1738 0.0900 -0.3502 0.0027 3.73 0.0536
Potkil 124-139 1 -0.1594 0.1410 -0.4356 0.1169 1.28 0.2583
Potkil 140-143 1 0.1604 0.4090 -0.6413 0.9621 0.15 0.6949
Potkil 144-150 1 0.2581 0.1709 -0.0769 0.5931 2.28 0.1310
Potkil 151- 1 -0.4037 0.1564 -0.7102 -0.0972 6.67 0.0098
Potkil 17-26 1 -0.3305 0.0423 -0.4133 -0.2477 61.15 <.0001
Potkil 27-33 1 -0.2620 0.0325 -0.3256 -0.1984 65.19 <.0001
Potkil 34-39 1 -0.2846 0.0429 -0.3687 -0.2005 44.00 <.0001
Potkil 40-49 1 -0.1597 0.0328 -0.2240 -0.0954 23.72 <.0001
Potkil 50-57 1 -0.1673 0.0342 -0.2343 -0.1003 23.95 <.0001
Potkil 58-65 1 -0.0596 0.0405 -0.1390 0.0198 2.17 0.1410
Potkil 79-92 1 -0.0810 0.0413 -0.1619 -0.0001 3.85 0.0497
Potkil 93-108 1 -0.0260 0.0503 -0.1245 0.0725 0.27 0.6055
Potkil 66-78 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 8 548.35 <.0001
Potkil 13 136.19 <.0001
proc genmod data = polizzecum; class eta(ref='35-43') potkil(ref='66-78') massa(ref='906-980'); model nsincum = eta potkil massa / dist = poisson offset = lnespocum type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 9 18-22 23-26 27-30 31-34 44-51 52-60 61-69 70- 35-43
Potkil 14 109-123 124-139 140-143 144-150 151- 17-26 27-33 34-39 40-49 50-57 58-65 79-92 93-108 66-78
Massa 12 1031-1094 1095-1269 1270-1379 1380-1424 1425-1520 1521- 555-691 692-720 721-800 801-905 981-1030 906-980
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 20178.0174 0.7697
Scaled Deviance 26E3 20178.0174 0.7697
Pearson Chi-Square 26E3 37643.0704 1.4359
Scaled Pearson X2 26E3 37643.0704 1.4359
Log Likelihood   -11418.8138  
Full Log Likelihood   -18148.4738  
AIC (smaller is better)   36362.9476  
AICC (smaller is better)   36363.0332  
BIC (smaller is better)   36632.7352  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -2.2876 0.0430 -2.3718 -2.2033 2832.47 <.0001
Eta 18-22 1 0.7991 0.0380 0.7247 0.8735 443.04 <.0001
Eta 23-26 1 0.5046 0.0341 0.4379 0.5714 219.49 <.0001
Eta 27-30 1 0.2227 0.0350 0.1541 0.2913 40.47 <.0001
Eta 31-34 1 0.1010 0.0363 0.0299 0.1722 7.75 0.0054
Eta 44-51 1 0.1930 0.0310 0.1322 0.2538 38.71 <.0001
Eta 52-60 1 0.2356 0.0318 0.1732 0.2980 54.80 <.0001
Eta 61-69 1 0.1111 0.0383 0.0361 0.1861 8.43 0.0037
Eta 70- 1 0.2193 0.0489 0.1235 0.3151 20.13 <.0001
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil 109-123 1 -0.2378 0.0925 -0.4192 -0.0565 6.61 0.0102
Potkil 124-139 1 -0.2294 0.1432 -0.5100 0.0512 2.57 0.1091
Potkil 140-143 1 0.0761 0.4097 -0.7269 0.8790 0.03 0.8527
Potkil 144-150 1 0.1513 0.1739 -0.1896 0.4923 0.76 0.3843
Potkil 151- 1 -0.6593 0.1647 -0.9822 -0.3365 16.03 <.0001
Potkil 17-26 1 -0.2049 0.0696 -0.3414 -0.0685 8.67 0.0032
Potkil 27-33 1 -0.1956 0.0540 -0.3016 -0.0897 13.11 0.0003
Potkil 34-39 1 -0.2438 0.0581 -0.3576 -0.1300 17.64 <.0001
Potkil 40-49 1 -0.1569 0.0440 -0.2432 -0.0706 12.70 0.0004
Potkil 50-57 1 -0.1634 0.0382 -0.2383 -0.0885 18.27 <.0001
Potkil 58-65 1 -0.0505 0.0425 -0.1337 0.0328 1.41 0.2346
Potkil 79-92 1 -0.0868 0.0417 -0.1685 -0.0051 4.34 0.0373
Potkil 93-108 1 -0.0473 0.0538 -0.1527 0.0581 0.77 0.3791
Potkil 66-78 0 0.0000 0.0000 0.0000 0.0000 . .
Massa 1031-1094 1 -0.1086 0.0461 -0.1990 -0.0182 5.55 0.0185
Massa 1095-1269 1 -0.0616 0.0393 -0.1387 0.0155 2.45 0.1175
Massa 1270-1379 1 0.0015 0.0585 -0.1132 0.1162 0.00 0.9799
Massa 1380-1424 1 -0.2159 0.1130 -0.4373 0.0055 3.65 0.0560
Massa 1425-1520 1 0.2228 0.0840 0.0581 0.3874 7.03 0.0080
Massa 1521- 1 0.4026 0.1073 0.1924 0.6129 14.09 0.0002
Massa 555-691 1 -0.2393 0.0708 -0.3781 -0.1005 11.42 0.0007
Massa 692-720 1 -0.1379 0.0580 -0.2515 -0.0243 5.66 0.0174
Massa 721-800 1 -0.0946 0.0464 -0.1855 -0.0036 4.15 0.0416
Massa 801-905 1 -0.0154 0.0385 -0.0908 0.0599 0.16 0.6878
Massa 981-1030 1 -0.0867 0.0394 -0.1640 -0.0094 4.84 0.0279
Massa 906-980 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 8 537.11 <.0001
Potkil 13 51.08 <.0001
Massa 11 53.01 <.0001
proc genmod data = polizzecum; class eta(ref='35-43') potkil(ref='66-78') massa(ref='906-980') potf; model nsincum = eta potkil massa potf/ dist = poisson offset = lnespocum type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 9 18-22 23-26 27-30 31-34 44-51 52-60 61-69 70- 35-43
Potkil 14 109-123 124-139 140-143 144-150 151- 17-26 27-33 34-39 40-49 50-57 58-65 79-92 93-108 66-78
Massa 12 1031-1094 1095-1269 1270-1379 1380-1424 1425-1520 1521- 555-691 692-720 721-800 801-905 981-1030 906-980
potf 9 14-15 16 17-21 22-23 24-26 27-28 29-30 31- 8-13
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 20079.5225 0.7662
Scaled Deviance 26E3 20079.5225 0.7662
Pearson Chi-Square 26E3 36510.7622 1.3931
Scaled Pearson X2 26E3 36510.7622 1.3931
Log Likelihood   -11369.5664  
Full Log Likelihood   -18099.2263  
AIC (smaller is better)   36280.4526  
AICC (smaller is better)   36280.5841  
BIC (smaller is better)   36615.6433  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -2.5882 0.0602 -2.7061 -2.4703 1851.24 <.0001
Eta 18-22 1 0.7942 0.0380 0.7198 0.8686 437.50 <.0001
Eta 23-26 1 0.4959 0.0341 0.4291 0.5627 211.78 <.0001
Eta 27-30 1 0.2150 0.0350 0.1464 0.2836 37.72 <.0001
Eta 31-34 1 0.0979 0.0363 0.0267 0.1690 7.27 0.0070
Eta 44-51 1 0.1919 0.0310 0.1311 0.2527 38.26 <.0001
Eta 52-60 1 0.2371 0.0318 0.1747 0.2995 55.49 <.0001
Eta 61-69 1 0.1149 0.0383 0.0399 0.1899 9.01 0.0027
Eta 70- 1 0.2256 0.0489 0.1298 0.3215 21.30 <.0001
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil 109-123 1 -0.1700 0.0934 -0.3531 0.0131 3.31 0.0688
Potkil 124-139 1 -0.1686 0.1518 -0.4662 0.1289 1.23 0.2667
Potkil 140-143 1 0.0173 0.4120 -0.7902 0.8249 0.00 0.9664
Potkil 144-150 1 0.2577 0.1757 -0.0868 0.6021 2.15 0.1426
Potkil 151- 1 -0.4219 0.1931 -0.8004 -0.0434 4.77 0.0289
Potkil 17-26 1 -0.0081 0.0742 -0.1536 0.1374 0.01 0.9132
Potkil 27-33 1 -0.0074 0.0594 -0.1238 0.1089 0.02 0.9003
Potkil 34-39 1 -0.0669 0.0624 -0.1892 0.0554 1.15 0.2835
Potkil 40-49 1 -0.0389 0.0461 -0.1293 0.0514 0.71 0.3982
Potkil 50-57 1 -0.1060 0.0398 -0.1839 -0.0280 7.10 0.0077
Potkil 58-65 1 -0.0148 0.0428 -0.0987 0.0690 0.12 0.7285
Potkil 79-92 1 -0.0985 0.0419 -0.1807 -0.0164 5.53 0.0187
Potkil 93-108 1 -0.0164 0.0543 -0.1229 0.0900 0.09 0.7622
Potkil 66-78 0 0.0000 0.0000 0.0000 0.0000 . .
Massa 1031-1094 1 -0.2098 0.0487 -0.3053 -0.1142 18.52 <.0001
Massa 1095-1269 1 -0.1972 0.0434 -0.2823 -0.1121 20.62 <.0001
Massa 1270-1379 1 -0.1783 0.0624 -0.3006 -0.0560 8.16 0.0043
Massa 1380-1424 1 -0.3791 0.1146 -0.6038 -0.1544 10.94 0.0009
Massa 1425-1520 1 -0.0592 0.0920 -0.2395 0.1212 0.41 0.5202
Massa 1521- 1 0.0498 0.1262 -0.1976 0.2973 0.16 0.6930
Massa 555-691 1 -0.1430 0.0720 -0.2841 -0.0019 3.94 0.0470
Massa 692-720 1 -0.0287 0.0601 -0.1464 0.0890 0.23 0.6324
Massa 721-800 1 0.0150 0.0492 -0.0814 0.1113 0.09 0.7605
Massa 801-905 1 0.0366 0.0394 -0.0406 0.1138 0.86 0.3531
Massa 981-1030 1 -0.1363 0.0403 -0.2153 -0.0573 11.43 0.0007
Massa 906-980 0 0.0000 0.0000 0.0000 0.0000 . .
potf 14-15 1 0.2045 0.0378 0.1305 0.2786 29.34 <.0001
potf 16 1 0.1562 0.0560 0.0464 0.2660 7.77 0.0053
potf 17-21 1 0.4110 0.0514 0.3103 0.5117 64.01 <.0001
potf 22-23 1 0.7827 0.0882 0.6098 0.9555 78.77 <.0001
potf 24-26 1 0.4922 0.2383 0.0252 0.9592 4.27 0.0389
potf 27-28 1 0.0035 0.6017 -1.1758 1.1829 0.00 0.9953
potf 29-30 1 0.2932 0.3754 -0.4426 1.0289 0.61 0.4349
potf 31- 1 0.1805 0.4017 -0.6070 0.9679 0.20 0.6533
potf 8-13 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 8 526.37 <.0001
Potkil 13 25.04 0.0228
Massa 11 51.68 <.0001
potf 8 98.49 <.0001
proc genmod data = polizzecum; class eta(ref='35-43') potkil(ref='66-78') massa(ref='906-980') bendie; model nsincum = eta potkil massa bendie / dist = poisson offset = lnespocum type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 9 18-22 23-26 27-30 31-34 44-51 52-60 61-69 70- 35-43
Potkil 14 109-123 124-139 140-143 144-150 151- 17-26 27-33 34-39 40-49 50-57 58-65 79-92 93-108 66-78
Massa 12 1031-1094 1095-1269 1270-1379 1380-1424 1425-1520 1521- 555-691 692-720 721-800 801-905 981-1030 906-980
Bendie 2 B D
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 19964.4087 0.7616
Scaled Deviance 26E3 19964.4087 0.7616
Pearson Chi-Square 26E3 35130.4937 1.3401
Scaled Pearson X2 26E3 35130.4937 1.3401
Log Likelihood   -11312.0095  
Full Log Likelihood   -18041.6694  
AIC (smaller is better)   36151.3389  
AICC (smaller is better)   36151.4296  
BIC (smaller is better)   36429.3019  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.8284 0.0522 -1.9308 -1.7260 1224.67 <.0001
Eta 18-22 1 0.7887 0.0380 0.7143 0.8631 431.53 <.0001
Eta 23-26 1 0.4885 0.0341 0.4217 0.5553 205.50 <.0001
Eta 27-30 1 0.2112 0.0350 0.1426 0.2798 36.38 <.0001
Eta 31-34 1 0.0929 0.0363 0.0217 0.1640 6.55 0.0105
Eta 44-51 1 0.1911 0.0310 0.1303 0.2519 37.97 <.0001
Eta 52-60 1 0.2374 0.0318 0.1750 0.2997 55.64 <.0001
Eta 61-69 1 0.1144 0.0383 0.0394 0.1894 8.94 0.0028
Eta 70- 1 0.2273 0.0489 0.1316 0.3231 21.64 <.0001
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil 109-123 1 -0.0330 0.0931 -0.2155 0.1494 0.13 0.7227
Potkil 124-139 1 -0.0001 0.1437 -0.2817 0.2816 0.00 0.9997
Potkil 140-143 1 0.2989 0.4098 -0.5043 1.1021 0.53 0.4658
Potkil 144-150 1 0.3904 0.1741 0.0491 0.7317 5.02 0.0250
Potkil 151- 1 -0.3129 0.1654 -0.6370 0.0112 3.58 0.0585
Potkil 17-26 1 -0.3231 0.0697 -0.4596 -0.1866 21.51 <.0001
Potkil 27-33 1 -0.3169 0.0541 -0.4231 -0.2108 34.26 <.0001
Potkil 34-39 1 -0.3685 0.0582 -0.4825 -0.2545 40.15 <.0001
Potkil 40-49 1 -0.2533 0.0441 -0.3397 -0.1670 33.06 <.0001
Potkil 50-57 1 -0.2147 0.0385 -0.2900 -0.1393 31.14 <.0001
Potkil 58-65 1 -0.0600 0.0425 -0.1433 0.0233 1.99 0.1578
Potkil 79-92 1 -0.0013 0.0421 -0.0839 0.0812 0.00 0.9749
Potkil 93-108 1 0.1026 0.0542 -0.0036 0.2089 3.58 0.0584
Potkil 66-78 0 0.0000 0.0000 0.0000 0.0000 . .
Massa 1031-1094 1 -0.1483 0.0461 -0.2387 -0.0580 10.35 0.0013
Massa 1095-1269 1 -0.1403 0.0398 -0.2182 -0.0624 12.45 0.0004
Massa 1270-1379 1 -0.1867 0.0596 -0.3034 -0.0699 9.82 0.0017
Massa 1380-1424 1 -0.3746 0.1130 -0.5960 -0.1532 10.99 0.0009
Massa 1425-1520 1 -0.0823 0.0858 -0.2504 0.0859 0.92 0.3376
Massa 1521- 1 0.0122 0.1096 -0.2025 0.2270 0.01 0.9110
Massa 555-691 1 -0.0757 0.0716 -0.2161 0.0646 1.12 0.2904
Massa 692-720 1 0.0265 0.0589 -0.0890 0.1420 0.20 0.6534
Massa 721-800 1 0.0621 0.0475 -0.0310 0.1552 1.71 0.1910
Massa 801-905 1 0.0875 0.0390 0.0112 0.1639 5.04 0.0247
Massa 981-1030 1 -0.0437 0.0395 -0.1212 0.0337 1.23 0.2683
Massa 906-980 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.5015 0.0330 -0.5661 -0.4369 231.24 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 8 518.15 <.0001
Potkil 13 78.41 <.0001
Massa 11 48.61 <.0001
Bendie 1 213.61 <.0001
proc genmod data = polizzecum; class eta(ref='35-43') potkil(ref='66-78') massa(ref='906-980') bendie sesso; model nsincum = eta potkil massa bendie sesso / dist = poisson offset = lnespocum type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 9 18-22 23-26 27-30 31-34 44-51 52-60 61-69 70- 35-43
Potkil 14 109-123 124-139 140-143 144-150 151- 17-26 27-33 34-39 40-49 50-57 58-65 79-92 93-108 66-78
Massa 12 1031-1094 1095-1269 1270-1379 1380-1424 1425-1520 1521- 555-691 692-720 721-800 801-905 981-1030 906-980
Bendie 2 B D
Sesso 2 F M
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 19964.3907 0.7616
Scaled Deviance 26E3 19964.3907 0.7616
Pearson Chi-Square 26E3 35140.5681 1.3405
Scaled Pearson X2 26E3 35140.5681 1.3405
Log Likelihood   -11312.0005  
Full Log Likelihood   -18041.6604  
AIC (smaller is better)   36153.3209  
AICC (smaller is better)   36153.4170  
BIC (smaller is better)   36439.4593  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.8281 0.0523 -1.9306 -1.7256 1221.91 <.0001
Eta 18-22 1 0.7886 0.0380 0.7141 0.8630 431.18 <.0001
Eta 23-26 1 0.4885 0.0341 0.4217 0.5552 205.48 <.0001
Eta 27-30 1 0.2112 0.0350 0.1426 0.2798 36.39 <.0001
Eta 31-34 1 0.0929 0.0363 0.0218 0.1640 6.55 0.0105
Eta 44-51 1 0.1910 0.0310 0.1302 0.2518 37.90 <.0001
Eta 52-60 1 0.2370 0.0319 0.1745 0.2996 55.18 <.0001
Eta 61-69 1 0.1138 0.0385 0.0384 0.1893 8.75 0.0031
Eta 70- 1 0.2266 0.0492 0.1302 0.3230 21.21 <.0001
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil 109-123 1 -0.0332 0.0931 -0.2156 0.1493 0.13 0.7215
Potkil 124-139 1 -0.0002 0.1437 -0.2818 0.2815 0.00 0.9990
Potkil 140-143 1 0.2987 0.4098 -0.5045 1.1019 0.53 0.4661
Potkil 144-150 1 0.3901 0.1742 0.0488 0.7315 5.02 0.0251
Potkil 151- 1 -0.3132 0.1654 -0.6373 0.0110 3.59 0.0583
Potkil 17-26 1 -0.3223 0.0699 -0.4593 -0.1852 21.25 <.0001
Potkil 27-33 1 -0.3164 0.0543 -0.4228 -0.2099 33.93 <.0001
Potkil 34-39 1 -0.3679 0.0583 -0.4822 -0.2536 39.80 <.0001
Potkil 40-49 1 -0.2529 0.0441 -0.3394 -0.1664 32.84 <.0001
Potkil 50-57 1 -0.2145 0.0385 -0.2899 -0.1391 31.08 <.0001
Potkil 58-65 1 -0.0600 0.0425 -0.1433 0.0233 1.99 0.1578
Potkil 79-92 1 -0.0014 0.0421 -0.0840 0.0812 0.00 0.9733
Potkil 93-108 1 0.1024 0.0542 -0.0038 0.2087 3.57 0.0589
Potkil 66-78 0 0.0000 0.0000 0.0000 0.0000 . .
Massa 1031-1094 1 -0.1484 0.0461 -0.2387 -0.0580 10.35 0.0013
Massa 1095-1269 1 -0.1403 0.0398 -0.2182 -0.0624 12.45 0.0004
Massa 1270-1379 1 -0.1866 0.0596 -0.3034 -0.0698 9.81 0.0017
Massa 1380-1424 1 -0.3745 0.1130 -0.5959 -0.1530 10.99 0.0009
Massa 1425-1520 1 -0.0821 0.0858 -0.2502 0.0861 0.91 0.3389
Massa 1521- 1 0.0127 0.1096 -0.2022 0.2275 0.01 0.9081
Massa 555-691 1 -0.0751 0.0718 -0.2158 0.0656 1.09 0.2956
Massa 692-720 1 0.0269 0.0590 -0.0888 0.1425 0.21 0.6489
Massa 721-800 1 0.0625 0.0476 -0.0308 0.1558 1.73 0.1889
Massa 801-905 1 0.0877 0.0390 0.0113 0.1641 5.06 0.0245
Massa 981-1030 1 -0.0438 0.0395 -0.1213 0.0336 1.23 0.2676
Massa 906-980 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.5012 0.0330 -0.5660 -0.4365 230.12 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Sesso F 1 -0.0028 0.0210 -0.0441 0.0384 0.02 0.8933
Sesso M 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 8 518.13 <.0001
Potkil 13 77.83 <.0001
Massa 11 48.62 <.0001
Bendie 1 212.73 <.0001
Sesso 1 0.02 0.8933
proc genmod data = polizzecum; class eta(ref='35-43') potkil(ref='66-78') massa(ref='906-980') bendie capoluogo; model nsincum = eta potkil massa bendie capoluogo / dist = poisson offset = lnespocum type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 9 18-22 23-26 27-30 31-34 44-51 52-60 61-69 70- 35-43
Potkil 14 109-123 124-139 140-143 144-150 151- 17-26 27-33 34-39 40-49 50-57 58-65 79-92 93-108 66-78
Massa 12 1031-1094 1095-1269 1270-1379 1380-1424 1425-1520 1521- 555-691 692-720 721-800 801-905 981-1030 906-980
Bendie 2 B D
Capoluogo 2 NO SI
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 19721.4813 0.7523
Scaled Deviance 26E3 19721.4813 0.7523
Pearson Chi-Square 26E3 32393.3269 1.2357
Scaled Pearson X2 26E3 32393.3269 1.2357
Log Likelihood   -11190.5458  
Full Log Likelihood   -17920.2058  
AIC (smaller is better)   35910.4115  
AICC (smaller is better)   35910.5076  
BIC (smaller is better)   36196.5499  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.5455 0.0550 -1.6533 -1.4378 790.46 <.0001
Eta 18-22 1 0.8086 0.0380 0.7342 0.8831 453.17 <.0001
Eta 23-26 1 0.4985 0.0341 0.4317 0.5653 213.96 <.0001
Eta 27-30 1 0.2148 0.0350 0.1462 0.2834 37.64 <.0001
Eta 31-34 1 0.0922 0.0363 0.0211 0.1634 6.46 0.0110
Eta 44-51 1 0.1864 0.0310 0.1256 0.2472 36.10 <.0001
Eta 52-60 1 0.2254 0.0318 0.1630 0.2878 50.14 <.0001
Eta 61-69 1 0.0937 0.0383 0.0186 0.1687 5.98 0.0144
Eta 70- 1 0.1927 0.0489 0.0968 0.2886 15.52 <.0001
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil 109-123 1 -0.0351 0.0931 -0.2175 0.1474 0.14 0.7063
Potkil 124-139 1 -0.0161 0.1437 -0.2978 0.2656 0.01 0.9108
Potkil 140-143 1 0.3003 0.4098 -0.5029 1.1035 0.54 0.4637
Potkil 144-150 1 0.4041 0.1742 0.0627 0.7455 5.38 0.0203
Potkil 151- 1 -0.3249 0.1654 -0.6492 -0.0007 3.86 0.0495
Potkil 17-26 1 -0.2975 0.0697 -0.4341 -0.1610 18.25 <.0001
Potkil 27-33 1 -0.3007 0.0541 -0.4068 -0.1946 30.84 <.0001
Potkil 34-39 1 -0.3507 0.0582 -0.4647 -0.2367 36.34 <.0001
Potkil 40-49 1 -0.2385 0.0440 -0.3248 -0.1522 29.32 <.0001
Potkil 50-57 1 -0.2035 0.0385 -0.2788 -0.1281 27.99 <.0001
Potkil 58-65 1 -0.0572 0.0425 -0.1404 0.0261 1.81 0.1784
Potkil 79-92 1 -0.0036 0.0421 -0.0861 0.0790 0.01 0.9327
Potkil 93-108 1 0.1003 0.0542 -0.0059 0.2066 3.42 0.0643
Potkil 66-78 0 0.0000 0.0000 0.0000 0.0000 . .
Massa 1031-1094 1 -0.1421 0.0461 -0.2325 -0.0517 9.49 0.0021
Massa 1095-1269 1 -0.1375 0.0398 -0.2155 -0.0596 11.96 0.0005
Massa 1270-1379 1 -0.1863 0.0596 -0.3031 -0.0695 9.78 0.0018
Massa 1380-1424 1 -0.3823 0.1130 -0.6037 -0.1608 11.45 0.0007
Massa 1425-1520 1 -0.0955 0.0858 -0.2638 0.0727 1.24 0.2659
Massa 1521- 1 0.0133 0.1096 -0.2016 0.2281 0.01 0.9036
Massa 555-691 1 -0.0942 0.0716 -0.2345 0.0461 1.73 0.1881
Massa 692-720 1 0.0211 0.0589 -0.0943 0.1366 0.13 0.7198
Massa 721-800 1 0.0604 0.0475 -0.0326 0.1535 1.62 0.2030
Massa 801-905 1 0.0851 0.0390 0.0088 0.1615 4.78 0.0289
Massa 981-1030 1 -0.0424 0.0395 -0.1198 0.0350 1.15 0.2832
Massa 906-980 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.5194 0.0330 -0.5841 -0.4547 247.75 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 -0.3422 0.0213 -0.3839 -0.3005 258.58 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 8 548.11 <.0001
Potkil 13 72.46 <.0001
Massa 11 48.64 <.0001
Bendie 1 228.22 <.0001
Capoluogo 1 242.93 <.0001
/* Accorpamento classi */ /* eta */ /* Accetti H0 - > Sì accorpamenti */ ods select contrasts; proc genmod data = polizzecum; class eta(ref='35-43') potkil(ref='66-78') massa(ref='906-980') bendie capoluogo prov(ref='prov1'); model nsincum = eta potkil massa bendie capoluogo prov / dist = poisson offset = lnespocum type3; contrast "eta 61-" eta 0 0 0 0 0 0 1 -1 0; run;
SAS Output

The GENMOD Procedure

Contrast Results
Contrast DF Chi-Square Pr > ChiSq Type
eta 61- 1 3.67 0.0554 LR
/* potkil */ /* Accetto H0 -> Sì accorpamenti */ ods select contrasts; proc genmod data = polizzecum; class eta(ref='35-43') potkil(ref='66-78') massa(ref='906-980') bendie capoluogo prov(ref='prov1'); model nsincum = eta potkil massa bendie capoluogo prov / dist = poisson offset = lnespocum type3; contrast "potkil" potkil 1 -1 0 0 0 0 0 0 0 0 0 0 0 0, potkil 0 1 -1 0 0 0 0 0 0 0 0 0 0 0, potkil 0 0 1 -1 0 0 0 0 0 0 0 0 0 0, potkil 0 0 0 1 -1 0 0 0 0 0 0 0 0 0; run;
SAS Output

The GENMOD Procedure

Contrast Results
Contrast DF Chi-Square Pr > ChiSq Type
potkil 4 10.38 0.0345 LR
/* massa */ /* Accetto H0 -> Sì accorpamenti */ ods select contrasts; proc genmod data = polizzecum; class eta(ref='35-43') potkil(ref='66-78') massa(ref='906-980') bendie capoluogo prov(ref='prov1'); model nsincum = eta potkil massa bendie capoluogo prov / dist = poisson offset = lnespocum type3; contrast "massa" massa 0 0 0 0 0 0 1 -1 0 0 0 0, massa 0 0 0 0 0 0 0 1 -1 0 0 0, massa 0 0 0 0 0 0 0 0 1 -1 0 0, massa 0 0 0 0 0 0 0 0 0 0 1 -1; run;
SAS Output

The GENMOD Procedure

Contrast Results
Contrast DF Chi-Square Pr > ChiSq Type
massa 4 10.34 0.0350 LR
/* Faccio gli accorpamenti */ /* eta */ proc format; value classeta low-22 = "18-22" 23-26 = "23-26" 27-30 = "27-30" 31-34 = "31-34" 35-43 = "35-43" 44-51 = "44-51" 52-60 = "52-60" 61-high = "61-"; run; /* potkil */ proc format; value classpotkil low-57 = "-57" 58-high = "58-"; run; /* massa */ proc format; value classmassa low-1030 = "-1030" 1031-1379 = "1031-1379" 1380-1424 = "1380-1424" 1425-high = "1425-"; run; /* Il format si aggiorna in automatico nel dataset */ proc print data = polizze (obs = 10); run;
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf espo nsin dannotot freqsin lnespo
1 F 35-43 prov8 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
2 M 35-43 prov5 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
3 M 44-51 prov7 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
4 F 18-22 prov10 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
5 M 44-51 prov9 NO B -57 -1030 8-13 0.20000 0 0.000 0 -1.60944
6 F 44-51 prov8 NO B -57 -1030 14-15 1.00000 0 0.000 0 0.00000
7 M 35-43 prov1 NO D -57 1031-1379 17-21 1.00000 0 0.000 0 0.00000
8 M 61- prov1 SI B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
9 F 44-51 prov1 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
10 M 52-60 prov1 NO B 58- 1031-1379 17-21 1.00000 1 359.057 1 0.00000
/* modello con livelli accorpati */ proc genmod data = polizzecum; class eta(ref='35-43') potkil massa bendie capoluogo prov(ref='prov1'); model nsincum = eta potkil massa bendie capoluogo prov / dist = poisson offset = lnespocum type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 8 18-22 23-26 27-30 31-34 44-51 52-60 61- 35-43
Potkil 2 -57 58-
Massa 4 -1030 1031-1379 1380-1424 1425-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 12 prov10 prov11 prov12 prov2 prov3 prov4 prov5 prov6 prov7 prov8 prov9 prov1
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 19374.9753 0.7388
Scaled Deviance 26E3 19374.9753 0.7388
Pearson Chi-Square 26E3 31273.9757 1.1926
Scaled Pearson X2 26E3 31273.9757 1.1926
Log Likelihood   -11017.2928  
Full Log Likelihood   -17746.9527  
AIC (smaller is better)   35543.9055  
AICC (smaller is better)   35543.9550  
BIC (smaller is better)   35748.2900  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.7699 0.0677 -1.9027 -1.6372 682.67 <.0001
Eta 18-22 1 0.8400 0.0378 0.7660 0.9140 494.78 <.0001
Eta 23-26 1 0.5168 0.0339 0.4503 0.5833 232.00 <.0001
Eta 27-30 1 0.2237 0.0350 0.1551 0.2922 40.92 <.0001
Eta 31-34 1 0.0960 0.0363 0.0249 0.1672 7.01 0.0081
Eta 44-51 1 0.1825 0.0310 0.1217 0.2433 34.64 <.0001
Eta 52-60 1 0.2150 0.0318 0.1526 0.2774 45.67 <.0001
Eta 61- 1 0.1164 0.0336 0.0505 0.1824 11.98 0.0005
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.2159 0.0259 -0.2666 -0.1652 69.74 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Massa -1030 1 0.0076 0.0647 -0.1192 0.1345 0.01 0.9062
Massa 1031-1379 1 -0.0946 0.0612 -0.2146 0.0253 2.39 0.1221
Massa 1380-1424 1 -0.2787 0.1190 -0.5120 -0.0455 5.49 0.0192
Massa 1425- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.4852 0.0303 -0.5446 -0.4258 256.22 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 -0.2836 0.0216 -0.3260 -0.2411 171.59 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10 1 -0.2317 0.0485 -0.3268 -0.1366 22.82 <.0001
Prov prov11 1 0.5183 0.0475 0.4252 0.6114 119.09 <.0001
Prov prov12 1 -0.4993 0.1147 -0.7242 -0.2745 18.95 <.0001
Prov prov2 1 0.3631 0.0630 0.2397 0.4865 33.24 <.0001
Prov prov3 1 0.0533 0.0364 -0.0179 0.1246 2.15 0.1424
Prov prov4 1 -0.0786 0.0338 -0.1448 -0.0125 5.43 0.0198
Prov prov5 1 0.1152 0.0335 0.0495 0.1809 11.81 0.0006
Prov prov6 1 0.2006 0.0350 0.1319 0.2692 32.78 <.0001
Prov prov7 1 0.2210 0.0428 0.1371 0.3049 26.66 <.0001
Prov prov8 1 0.2775 0.0313 0.2161 0.3389 78.46 <.0001
Prov prov9 1 0.3905 0.0484 0.2957 0.4854 65.18 <.0001
Prov prov1 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 7 598.63 <.0001
Potkil 1 67.96 <.0001
Massa 3 18.65 0.0003
Bendie 1 231.49 <.0001
Capoluogo 1 163.48 <.0001
Prov 11 403.20 <.0001
/* rimuovo massa */ proc genmod data = polizzecum; class eta(ref='35-43') potkil bendie capoluogo prov(ref='prov1'); model nsincum = eta potkil bendie capoluogo prov / dist = poisson offset = lnespocum type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 8 18-22 23-26 27-30 31-34 44-51 52-60 61- 35-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 12 prov10 prov11 prov12 prov2 prov3 prov4 prov5 prov6 prov7 prov8 prov9 prov1
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 19393.6287 0.7395
Scaled Deviance 26E3 19393.6287 0.7395
Pearson Chi-Square 26E3 31381.2516 1.1965
Scaled Pearson X2 26E3 31381.2516 1.1965
Log Likelihood   -11026.6195  
Full Log Likelihood   -17756.2794  
AIC (smaller is better)   35556.5588  
AICC (smaller is better)   35556.5974  
BIC (smaller is better)   35736.4173  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.8533 0.0439 -1.9394 -1.7672 1780.63 <.0001
Eta 18-22 1 0.8516 0.0376 0.7778 0.9253 512.06 <.0001
Eta 23-26 1 0.5255 0.0338 0.4592 0.5918 241.26 <.0001
Eta 27-30 1 0.2280 0.0349 0.1596 0.2965 42.61 <.0001
Eta 31-34 1 0.0976 0.0363 0.0265 0.1687 7.24 0.0071
Eta 44-51 1 0.1832 0.0310 0.1225 0.2440 34.93 <.0001
Eta 52-60 1 0.2165 0.0318 0.1541 0.2788 46.32 <.0001
Eta 61- 1 0.1192 0.0336 0.0532 0.1851 12.55 0.0004
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.1544 0.0190 -0.1917 -0.1171 65.89 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.4639 0.0288 -0.5204 -0.4074 258.83 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 -0.2837 0.0216 -0.3261 -0.2413 171.79 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10 1 -0.2306 0.0485 -0.3256 -0.1355 22.59 <.0001
Prov prov11 1 0.5229 0.0475 0.4298 0.6159 121.32 <.0001
Prov prov12 1 -0.4986 0.1147 -0.7234 -0.2737 18.89 <.0001
Prov prov2 1 0.3638 0.0630 0.2403 0.4872 33.37 <.0001
Prov prov3 1 0.0527 0.0364 -0.0186 0.1240 2.10 0.1473
Prov prov4 1 -0.0784 0.0338 -0.1445 -0.0122 5.39 0.0202
Prov prov5 1 0.1160 0.0335 0.0503 0.1817 11.97 0.0005
Prov prov6 1 0.2018 0.0350 0.1332 0.2705 33.20 <.0001
Prov prov7 1 0.2228 0.0428 0.1390 0.3067 27.11 <.0001
Prov prov8 1 0.2798 0.0313 0.2184 0.3412 79.82 <.0001
Prov prov9 1 0.3915 0.0484 0.2967 0.4863 65.50 <.0001
Prov prov1 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 7 620.66 <.0001
Potkil 1 64.81 <.0001
Bendie 1 230.93 <.0001
Capoluogo 1 163.67 <.0001
Prov 11 407.01 <.0001
/* Province */ /* Accetto H0 -> Accorpo i livelli */ ods select contrasts; proc genmod data = polizzecum; class eta(ref='35-43') potkil massa bendie capoluogo prov(ref='prov1'); model nsincum = eta potkil massa bendie capoluogo prov / dist = poisson offset = lnespocum type3; contrast "province" prov 1 0 -1 0 0 0 0 0 0 0 0 0, /* prov10-prov12 */ prov 0 0 0 1 0 0 0 0 0 0 -1 0, /* prov2-prov9 */ prov 0 0 0 0 1 0 0 0 0 0 0 -1; /* prov1-prov3 */ run;
SAS Output

The GENMOD Procedure

Contrast Results
Contrast DF Chi-Square Pr > ChiSq Type
province 3 7.56 0.0561 LR
/* Accorpo le province */ /* prov */ proc format; value $classprov "RC","VT","CN","OR","RA","VC","FE","LC","SS","VV","BZ","PV","RG","CH","PG","AR","TE","TN","VR","EN","NO","SV","VI","MC","MT","RE","BS","RI","AG","AV","PC" = "prov1-3" "BN","PO","IM","BA","PT","TA","SP","CA","ROMA","PA" = "prov2-9" "AL","SO","GO","LT","PR","PN","GR","UD","TV","PD" = "prov4" "SI","TR","AP","LO","FG","ME","LU","CZ","FR","CT","VE","BG","IS","MO","TP" = "prov5" "CL","PI","VA","BR","FO","LI","SR","CO","SA" = "prov6" "LE","RN","AN","MS","BO","GE","TS" = "prov7" "CB","FI","NU","PE","TO","MI" = "prov8" "BL","PZ","BI","CR","CS","AT","MN","PS","AQ","RSM","VB","RO" = "prov10-12" "AO","NA","CE","KR" = "prov11"; run; proc print data = polizze (obs = 10); run;
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf espo nsin dannotot freqsin lnespo
1 F 35-43 prov8 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
2 M 35-43 prov5 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
3 M 44-51 prov7 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
4 F 18-22 prov10-12 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
5 M 44-51 prov2-9 NO B -57 -1030 8-13 0.20000 0 0.000 0 -1.60944
6 F 44-51 prov8 NO B -57 -1030 14-15 1.00000 0 0.000 0 0.00000
7 M 35-43 prov1-3 NO D -57 1031-1379 17-21 1.00000 0 0.000 0 0.00000
8 M 61- prov1-3 SI B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
9 F 44-51 prov1-3 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
10 M 52-60 prov1-3 NO B 58- 1031-1379 17-21 1.00000 1 359.057 1 0.00000
/* Modello di Poisson definitivo */ proc genmod data = polizzecum plots = stdreschi; class eta(ref='35-43') potkil bendie capoluogo prov(ref='prov1-3'); model nsincum = eta potkil bendie capoluogo prov / dist = poisson offset = lnespocum type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 8 18-22 23-26 27-30 31-34 44-51 52-60 61- 35-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 9 prov10-12 prov11 prov2-9 prov4 prov5 prov6 prov7 prov8 prov1-3
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 19401.1531 0.7397
Scaled Deviance 26E3 19401.1531 0.7397
Pearson Chi-Square 26E3 31341.9422 1.1949
Scaled Pearson X2 26E3 31341.9422 1.1949
Log Likelihood   -11030.3817  
Full Log Likelihood   -17760.0417  
AIC (smaller is better)   35558.0833  
AICC (smaller is better)   35558.1123  
BIC (smaller is better)   35713.4156  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.8338 0.0417 -1.9156 -1.7520 1930.62 <.0001
Eta 18-22 1 0.8517 0.0376 0.7780 0.9255 512.26 <.0001
Eta 23-26 1 0.5256 0.0338 0.4593 0.5919 241.34 <.0001
Eta 27-30 1 0.2280 0.0349 0.1595 0.2964 42.58 <.0001
Eta 31-34 1 0.0974 0.0363 0.0263 0.1685 7.22 0.0072
Eta 44-51 1 0.1833 0.0310 0.1225 0.2440 34.94 <.0001
Eta 52-60 1 0.2171 0.0318 0.1547 0.2794 46.57 <.0001
Eta 61- 1 0.1193 0.0336 0.0533 0.1852 12.57 0.0004
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.1546 0.0190 -0.1919 -0.1173 66.05 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.4636 0.0288 -0.5201 -0.4071 258.53 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 -0.2839 0.0216 -0.3263 -0.2416 172.74 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10-12 1 -0.2886 0.0439 -0.3747 -0.2025 43.21 <.0001
Prov prov11 1 0.5033 0.0455 0.4142 0.5924 122.63 <.0001
Prov prov2-9 1 0.3623 0.0389 0.2860 0.4385 86.64 <.0001
Prov prov4 1 -0.0980 0.0308 -0.1584 -0.0375 10.09 0.0015
Prov prov5 1 0.0964 0.0306 0.0365 0.1563 9.94 0.0016
Prov prov6 1 0.1822 0.0322 0.1191 0.2454 31.99 <.0001
Prov prov7 1 0.2032 0.0405 0.1238 0.2827 25.13 <.0001
Prov prov8 1 0.2602 0.0281 0.2050 0.3154 85.46 <.0001
Prov prov1-3 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 7 620.90 <.0001
Potkil 1 64.97 <.0001
Bendie 1 230.67 <.0001
Capoluogo 1 164.52 <.0001
Prov 8 399.48 <.0001

The GENMOD Procedure

Plot of Standardized Pearson Residual by Observation
/* Modello di Poisson definitivo */ proc genmod data = polizzecum plots = stdreschi(xbeta); class eta(ref='35-43') potkil bendie capoluogo prov(ref='prov1-3'); model nsincum = eta potkil bendie capoluogo prov / dist = poisson offset = lnespocum; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 8 18-22 23-26 27-30 31-34 44-51 52-60 61- 35-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 9 prov10-12 prov11 prov2-9 prov4 prov5 prov6 prov7 prov8 prov1-3
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 19401.1531 0.7397
Scaled Deviance 26E3 19401.1531 0.7397
Pearson Chi-Square 26E3 31341.9422 1.1949
Scaled Pearson X2 26E3 31341.9422 1.1949
Log Likelihood   -11030.3817  
Full Log Likelihood   -17760.0417  
AIC (smaller is better)   35558.0833  
AICC (smaller is better)   35558.1123  
BIC (smaller is better)   35713.4156  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.8338 0.0417 -1.9156 -1.7520 1930.62 <.0001
Eta 18-22 1 0.8517 0.0376 0.7780 0.9255 512.26 <.0001
Eta 23-26 1 0.5256 0.0338 0.4593 0.5919 241.34 <.0001
Eta 27-30 1 0.2280 0.0349 0.1595 0.2964 42.58 <.0001
Eta 31-34 1 0.0974 0.0363 0.0263 0.1685 7.22 0.0072
Eta 44-51 1 0.1833 0.0310 0.1225 0.2440 34.94 <.0001
Eta 52-60 1 0.2171 0.0318 0.1547 0.2794 46.57 <.0001
Eta 61- 1 0.1193 0.0336 0.0533 0.1852 12.57 0.0004
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.1546 0.0190 -0.1919 -0.1173 66.05 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.4636 0.0288 -0.5201 -0.4071 258.53 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 -0.2839 0.0216 -0.3263 -0.2416 172.74 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10-12 1 -0.2886 0.0439 -0.3747 -0.2025 43.21 <.0001
Prov prov11 1 0.5033 0.0455 0.4142 0.5924 122.63 <.0001
Prov prov2-9 1 0.3623 0.0389 0.2860 0.4385 86.64 <.0001
Prov prov4 1 -0.0980 0.0308 -0.1584 -0.0375 10.09 0.0015
Prov prov5 1 0.0964 0.0306 0.0365 0.1563 9.94 0.0016
Prov prov6 1 0.1822 0.0322 0.1191 0.2454 31.99 <.0001
Prov prov7 1 0.2032 0.0405 0.1238 0.2827 25.13 <.0001
Prov prov8 1 0.2602 0.0281 0.2050 0.3154 85.46 <.0001
Prov prov1-3 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.


The GENMOD Procedure

Plot of Deviance Residual by Linear Predictor

3.A.1.2 Modello di Poisson con sovradispersione

/* Modello con dati raggruppati */ proc genmod data = polizzecum; class eta(ref='35-43') potkil bendie capoluogo prov(ref='prov1-3'); model nsincum = eta potkil bendie capoluogo prov / dist = poisson offset = lnespocum scale = pearson type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 8 18-22 23-26 27-30 31-34 44-51 52-60 61- 35-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 9 prov10-12 prov11 prov2-9 prov4 prov5 prov6 prov7 prov8 prov1-3
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 19401.1531 0.7397
Scaled Deviance 26E3 16236.7808 0.6190
Pearson Chi-Square 26E3 31341.9422 1.1949
Scaled Pearson X2 26E3 26230.0000 1.0000
Log Likelihood   -9231.3013  
Full Log Likelihood   -17760.0417  
AIC (smaller is better)   35558.0833  
AICC (smaller is better)   35558.1123  
BIC (smaller is better)   35713.4156  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.8338 0.0456 -1.9233 -1.7444 1615.73 <.0001
Eta 18-22 1 0.8517 0.0411 0.7711 0.9323 428.71 <.0001
Eta 23-26 1 0.5256 0.0370 0.4531 0.5981 201.98 <.0001
Eta 27-30 1 0.2280 0.0382 0.1531 0.3028 35.63 <.0001
Eta 31-34 1 0.0974 0.0397 0.0197 0.1752 6.04 0.0140
Eta 44-51 1 0.1833 0.0339 0.1169 0.2497 29.24 <.0001
Eta 52-60 1 0.2171 0.0348 0.1489 0.2852 38.97 <.0001
Eta 61- 1 0.1193 0.0368 0.0472 0.1913 10.52 0.0012
Eta 35-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.1546 0.0208 -0.1953 -0.1138 55.28 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.4636 0.0315 -0.5254 -0.4018 216.36 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 -0.2839 0.0236 -0.3302 -0.2376 144.56 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10-12 1 -0.2886 0.0480 -0.3827 -0.1945 36.16 <.0001
Prov prov11 1 0.5033 0.0497 0.4059 0.6007 102.63 <.0001
Prov prov2-9 1 0.3623 0.0425 0.2789 0.4456 72.51 <.0001
Prov prov4 1 -0.0980 0.0337 -0.1640 -0.0319 8.45 0.0037
Prov prov5 1 0.0964 0.0334 0.0309 0.1619 8.32 0.0039
Prov prov6 1 0.1822 0.0352 0.1132 0.2513 26.77 <.0001
Prov prov7 1 0.2032 0.0443 0.1164 0.2901 21.03 <.0001
Prov prov8 1 0.2602 0.0308 0.1999 0.3205 71.52 <.0001
Prov prov1-3 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0931 0.0000 1.0931 1.0931    

Note:The scale parameter was estimated by the square root of Pearson's Chi-Square/DOF.

LR Statistics For Type 3 Analysis
Source Num DF Den DF F Value Pr > F Chi-Square Pr > ChiSq
Eta 7 26230 74.23 <.0001 519.63 <.0001
Potkil 1 26230 54.38 <.0001 54.38 <.0001
Bendie 1 26230 193.05 <.0001 193.05 <.0001
Capoluogo 1 26230 137.69 <.0001 137.69 <.0001
Prov 8 26230 41.79 <.0001 334.33 <.0001
/* Modello con dati raggruppati */ /* Accorpo ulteriormente i livelli di eta */ ods select contrasts; proc genmod data = polizzecum; class eta(ref='35-43') potkil bendie capoluogo prov(ref='prov1-3'); model nsincum = eta potkil bendie capoluogo prov / dist = poisson offset = lnespocum scale = pearson type3; contrast "eta" eta 0 0 0 1 0 0 0 -1; /* 31-34 con 35-43 */ /*eta 0 0 0 0 1 -1 0 0,*/ /* 44-51 con 52-60 */ /*eta 0 0 0 0 0 1 -1 0;*/ /* 52-60 con 61- */ run;
SAS Output

The GENMOD Procedure

Contrast Results
Contrast Num DF Den DF F Value Pr > F Chi-Square Pr > ChiSq Type
eta 1 26230 5.98 0.0145 5.98 0.0145 LR
/* Accorpo i livelli di eta */ /* eta */ proc format; value classeta low-22 = "18-22" 23-26 = "23-26" 27-30 = "27-30" 31-43 = "31-43" 44-51 = "44-51" 52-60 = "52-60" 61-high = "61-"; run; proc print data = polizze (obs = 10); run;
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf espo nsin dannotot freqsin lnespo
1 F 31-43 prov8 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
2 M 31-43 prov5 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
3 M 44-51 prov7 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
4 F 18-22 prov10-12 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
5 M 44-51 prov2-9 NO B -57 -1030 8-13 0.20000 0 0.000 0 -1.60944
6 F 44-51 prov8 NO B -57 -1030 14-15 1.00000 0 0.000 0 0.00000
7 M 31-43 prov1-3 NO D -57 1031-1379 17-21 1.00000 0 0.000 0 0.00000
8 M 61- prov1-3 SI B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
9 F 44-51 prov1-3 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
10 M 52-60 prov1-3 NO B 58- 1031-1379 17-21 1.00000 1 359.057 1 0.00000
/* Modello di Poisson con sovradispersione definitivo */ proc genmod data = polizzecum plots = stdreschi(xbeta); class eta(ref='31-43') potkil bendie capoluogo prov(ref='prov1-3'); model nsincum = eta potkil bendie capoluogo prov / dist = poisson offset = lnespocum scale = pearson type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZECUM
Distribution Poisson
Link Function Log
Dependent Variable nsincum
Offset Variable lnespocum
Number of Observations Read 26249
Number of Observations Used 26249
Class Level Information
Class Levels Values
Eta 7 18-22 23-26 27-30 44-51 52-60 61- 31-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 9 prov10-12 prov11 prov2-9 prov4 prov5 prov6 prov7 prov8 prov1-3
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 26E3 19408.3010 0.7399
Scaled Deviance 26E3 16187.7678 0.6171
Pearson Chi-Square 26E3 31449.6198 1.1989
Scaled Pearson X2 26E3 26231.0000 1.0000
Log Likelihood   -9203.0267  
Full Log Likelihood   -17763.6156  
AIC (smaller is better)   35563.2312  
AICC (smaller is better)   35563.2573  
BIC (smaller is better)   35710.3881  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.7995 0.0434 -1.8845 -1.7145 1722.27 <.0001
Eta 18-22 1 0.8176 0.0386 0.7419 0.8933 448.06 <.0001
Eta 23-26 1 0.4915 0.0342 0.4245 0.5584 207.06 <.0001
Eta 27-30 1 0.1939 0.0355 0.1244 0.2634 29.88 <.0001
Eta 44-51 1 0.1492 0.0308 0.0889 0.2095 23.50 <.0001
Eta 52-60 1 0.1830 0.0317 0.1208 0.2452 33.23 <.0001
Eta 61- 1 0.0852 0.0339 0.0187 0.1517 6.31 0.0120
Eta 31-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.1541 0.0208 -0.1950 -0.1133 54.76 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.4640 0.0316 -0.5259 -0.4021 216.03 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 -0.2840 0.0237 -0.3304 -0.2377 144.18 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10-12 1 -0.2889 0.0481 -0.3832 -0.1947 36.12 <.0001
Prov prov11 1 0.5036 0.0498 0.4060 0.6011 102.38 <.0001
Prov prov2-9 1 0.3622 0.0426 0.2787 0.4457 72.24 <.0001
Prov prov4 1 -0.0977 0.0338 -0.1639 -0.0315 8.38 0.0038
Prov prov5 1 0.0963 0.0335 0.0307 0.1619 8.27 0.0040
Prov prov6 1 0.1819 0.0353 0.1128 0.2511 26.59 <.0001
Prov prov7 1 0.2030 0.0444 0.1160 0.2900 20.92 <.0001
Prov prov8 1 0.2598 0.0308 0.1994 0.3202 71.08 <.0001
Prov prov1-3 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0950 0.0000 1.0950 1.0950    

Note:The scale parameter was estimated by the square root of Pearson's Chi-Square/DOF.

LR Statistics For Type 3 Analysis
Source Num DF Den DF F Value Pr > F Chi-Square Pr > ChiSq
Eta 6 26231 85.32 <.0001 511.91 <.0001
Potkil 1 26231 53.87 <.0001 53.87 <.0001
Bendie 1 26231 192.73 <.0001 192.73 <.0001
Capoluogo 1 26231 137.32 <.0001 137.32 <.0001
Prov 8 26231 41.63 <.0001 333.02 <.0001

The GENMOD Procedure

Plot of Deviance Residual by Linear Predictor

3.A.1.3 Modello Binomiale Negativa

proc print data = polizze (obs = 10); run;
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf espo nsin dannotot freqsin lnespo
1 F 31-43 prov8 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
2 M 31-43 prov5 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
3 M 44-51 prov7 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
4 F 18-22 prov10-12 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
5 M 44-51 prov2-9 NO B -57 -1030 8-13 0.20000 0 0.000 0 -1.60944
6 F 44-51 prov8 NO B -57 -1030 14-15 1.00000 0 0.000 0 0.00000
7 M 31-43 prov1-3 NO D -57 1031-1379 17-21 1.00000 0 0.000 0 0.00000
8 M 61- prov1-3 SI B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
9 F 44-51 prov1-3 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
10 M 52-60 prov1-3 NO B 58- 1031-1379 17-21 1.00000 1 359.057 1 0.00000
/* Stima preliminare di alpha */ /*ods exclude all;*/ /* Non stampo nell'output i risultati della proc genmod */ ods select ModelInfo; proc genmod data = polizze; output out = stime pred = nsinatt; class eta(ref='31-43') potkil bendie capoluogo prov(ref='prov1-3'); model nsin = eta potkil bendie capoluogo prov / dist = poisson offset = lnespo; run; /*ods exclude none;*/
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZE
Distribution Poisson
Link Function Log
Dependent Variable nsin
Offset Variable lnespo
proc print data = stime (obs = 10); run;
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf espo nsin dannotot freqsin lnespo nsinatt
1 F 31-43 prov8 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000 0.08700
2 M 31-43 prov5 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000 0.07387
3 M 44-51 prov7 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000 0.11133
4 F 18-22 prov10-12 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000 0.11383
5 M 44-51 prov2-9 NO B -57 -1030 8-13 0.20000 0 0.000 0 -1.60944 0.02238
6 F 44-51 prov8 NO B -57 -1030 14-15 1.00000 0 0.000 0 0.00000 0.10100
7 M 31-43 prov1-3 NO D -57 1031-1379 17-21 1.00000 0 0.000 0 0.00000 0.10671
8 M 61- prov1-3 SI B 58- -1030 14-15 1.00000 0 0.000 0 0.00000 0.11323
9 F 44-51 prov1-3 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000 0.09087
10 M 52-60 prov1-3 NO B 58- 1031-1379 17-21 1.00000 1 359.057 1 0.00000 0.09399
/* Stimatore di Cameron Trivedi */ /* Stimatore di Pinquet */ data alpha_dataset; set stime; /* Stimatore di Cameron Trievedi */ add = ((nsin - nsinatt)**2 - nsinatt) / nsinatt**2; /* Stimatore di Pinquet */ alphanum = nsinatt**2; alphaden = (nsin - nsinatt)**2 - nsinatt; keep nsincum nsinatt add alphanum alphaden; run; proc means data = alpha_dataset; var add alphanum alphaden; output out = alpha_sum sum = sadd salphanum salphaden; run; proc print data = alpha_sum (obs = 10); run;
SAS Output

The MEANS Procedure

Variable N Mean Std Dev Minimum Maximum
add
alphanum
alphaden
172161
172161
172161
37.9694385
0.0073439
0.0057876
14556.53
0.0087395
0.3862777
-6631.66
2.273133E-8
-0.3115638
5431253.23
0.2822487
23.8076966

Obs _TYPE_ _FREQ_ sadd salphanum salphaden
1 0 172161 6536856.50 1264.34 996.392
data alpha; set alpha_sum; /* Cameron Trivedi */ alpha_ct = (sadd / (_FREQ_ - 17))**(-1); /* Pinquet */ alpha_pinquet = salphanum / salphaden; keep alpha_ct alpha_pinquet; run; proc print data = alpha noobs; run;
SAS Output
alpha_ct alpha_pinquet
0.026334 1.26892
/* Modello Binomiale Negativa con alpha stimato tramite lo stimatore di Pinquet */ proc genmod data = polizze plots = stdreschi(xbeta); class eta(ref='31-43') potkil bendie capoluogo prov(ref='prov1-3'); alpha = 1.26892; mu = _MEAN_; y = _RESP_; variance var = mu + mu**2 / alpha; if y > 0 then d = 2 * (y * log(y / mu) - (alpha + y) * log((alpha + y) / (alpha + mu))); else if y = 0 then d = 2 * alpha * log(1 + mu / alpha); deviance dev = d; model nsin = eta potkil bendie capoluogo prov / link = log offset = lnespo; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZE
Distribution User
Link Function Log
Dependent Variable nsin
Offset Variable lnespo
Number of Observations Read 172161
Number of Observations Used 172161
Class Level Information
Class Levels Values
Eta 7 18-22 23-26 27-30 44-51 52-60 61- 31-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 9 prov10-12 prov11 prov2-9 prov4 prov5 prov6 prov7 prov8 prov1-3
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 17E4 57559.8543 0.3344
Scaled Deviance 17E4 57559.8543 0.3344
Pearson Chi-Square 17E4 192330.8433 1.1173
Scaled Pearson X2 17E4 192330.8433 1.1173
Log Likelihood   -28779.9272  
Full Log Likelihood   -28779.9272  
AIC (smaller is better)   57595.8543  
AICC (smaller is better)   57595.8583  
BIC (smaller is better)   57776.8657  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.7930 0.0414 -1.8741 -1.7118 1875.28 <.0001
Eta 18-22 1 0.8233 0.0371 0.7506 0.8961 491.88 <.0001
Eta 23-26 1 0.4948 0.0325 0.4311 0.5585 231.65 <.0001
Eta 27-30 1 0.1941 0.0335 0.1284 0.2597 33.54 <.0001
Eta 44-51 1 0.1499 0.0291 0.0930 0.2069 26.60 <.0001
Eta 52-60 1 0.1853 0.0300 0.1265 0.2441 38.11 <.0001
Eta 61- 1 0.0856 0.0320 0.0229 0.1483 7.16 0.0075
Eta 31-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.1558 0.0197 -0.1945 -0.1171 62.26 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.4677 0.0303 -0.5271 -0.4082 237.71 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 -0.2854 0.0225 -0.3296 -0.2413 160.48 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10-12 1 -0.2901 0.0451 -0.3784 -0.2017 41.38 <.0001
Prov prov11 1 0.5074 0.0480 0.4134 0.6014 111.95 <.0001
Prov prov2-9 1 0.3674 0.0407 0.2877 0.4472 81.54 <.0001
Prov prov4 1 -0.0976 0.0318 -0.1599 -0.0352 9.40 0.0022
Prov prov5 1 0.0974 0.0317 0.0353 0.1595 9.44 0.0021
Prov prov6 1 0.1827 0.0334 0.1172 0.2483 29.87 <.0001
Prov prov7 1 0.2034 0.0422 0.1208 0.2860 23.28 <.0001
Prov prov8 1 0.2596 0.0292 0.2023 0.3169 78.90 <.0001
Prov prov1-3 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.


The GENMOD Procedure

Plot of Deviance Residual by Linear Predictor
/* Modello Binomiale Negativa con alpha stimato tramite la massima verosimiglianza */ proc genmod data = polizze plots = stdreschi(xbeta); class eta(ref='31-43') potkil bendie capoluogo prov(ref='prov1-3'); model nsin = eta potkil bendie capoluogo prov / dist = negbin link = log offset = lnespo; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.POLIZZE
Distribution Negative Binomial
Link Function Log
Dependent Variable nsin
Offset Variable lnespo
Number of Observations Read 172161
Number of Observations Used 172161
Class Level Information
Class Levels Values
Eta 7 18-22 23-26 27-30 44-51 52-60 61- 31-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 9 prov10-12 prov11 prov2-9 prov4 prov5 prov6 prov7 prov8 prov1-3
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 17E4 57409.2051 0.3335
Scaled Deviance 17E4 57409.2051 0.3335
Pearson Chi-Square 17E4 192096.0927 1.1159
Scaled Pearson X2 17E4 192096.0927 1.1159
Log Likelihood   -44017.1675  
Full Log Likelihood   -44721.6472  
AIC (smaller is better)   89481.2943  
AICC (smaller is better)   89481.2987  
BIC (smaller is better)   89672.3618  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 -1.7928 0.0414 -1.8741 -1.7116 1871.02 <.0001
Eta 18-22 1 0.8235 0.0372 0.7506 0.8963 490.85 <.0001
Eta 23-26 1 0.4949 0.0325 0.4311 0.5586 231.28 <.0001
Eta 27-30 1 0.1941 0.0335 0.1283 0.2598 33.49 <.0001
Eta 44-51 1 0.1499 0.0291 0.0929 0.2070 26.56 <.0001
Eta 52-60 1 0.1853 0.0300 0.1265 0.2442 38.07 <.0001
Eta 61- 1 0.0856 0.0320 0.0228 0.1484 7.15 0.0075
Eta 31-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.1559 0.0198 -0.1946 -0.1171 62.18 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 -0.4677 0.0304 -0.5273 -0.4082 237.23 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 -0.2854 0.0226 -0.3296 -0.2412 160.21 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10-12 1 -0.2901 0.0451 -0.3785 -0.2017 41.34 <.0001
Prov prov11 1 0.5075 0.0480 0.4134 0.6016 111.71 <.0001
Prov prov2-9 1 0.3676 0.0407 0.2877 0.4474 81.42 <.0001
Prov prov4 1 -0.0975 0.0318 -0.1600 -0.0351 9.38 0.0022
Prov prov5 1 0.0974 0.0317 0.0352 0.1596 9.43 0.0021
Prov prov6 1 0.1827 0.0335 0.1171 0.2483 29.82 <.0001
Prov prov7 1 0.2034 0.0422 0.1207 0.2861 23.24 <.0001
Prov prov8 1 0.2596 0.0293 0.2023 0.3169 78.76 <.0001
Prov prov1-3 0 0.0000 0.0000 0.0000 0.0000 . .
Dispersion   1 0.8069 0.0589 0.6993 0.9310    

Note:The negative binomial dispersion parameter was estimated by maximum likelihood.


The GENMOD Procedure

Plot of Deviance Residual by Linear Predictor

3.A.2 Modelli per il danno per sinistro

Preparazione dei dati

data danni; set dati.danni; run; proc print data = danni (obs = 10); run;
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf danno
1 M 55 AR NO B 80 1180 18 359.06
2 M 56 TE NO B 55 1120 17 1617.55
3 F 33 VC NO B 36 795 14 179.53
4 F 56 BL NO B 66 1050 17 691.19
5 M 73 MS NO B 36 765 13 1617.55
6 M 61 VI NO B 77 1200 18 1201.05
7 F 31 BA NO B 52 990 15 538.59
8 M 37 VR NO B 103 1420 20 359.06
9 F 53 FO NO B 25 700 10 6059.09
10 M 70 FI NO B 65 1010 17 771.97
/* Applico la partizione in livelli definita precedentemente */ data danni; set danni; format prov $classprov.; format eta classeta.; format potf classpotf.; format potkil classpotkil.; format massa classmassa.; run; proc print data = danni (obs = 10); run;
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf danno
1 M 52-60 prov1-3 NO B 58- 1031-1379 17-21 359.06
2 M 52-60 prov1-3 NO B -57 1031-1379 17-21 1617.55
3 F 31-43 prov1-3 NO B -57 -1030 14-15 179.53
4 F 52-60 prov10-12 NO B 58- 1031-1379 17-21 691.19
5 M 61- prov7 NO B -57 -1030 8-13 1617.55
6 M 61- prov1-3 NO B 58- 1031-1379 17-21 1201.05
7 F 31-43 prov2-9 NO B -57 -1030 14-15 538.59
8 M 31-43 prov1-3 NO B 58- 1380-1424 17-21 359.06
9 F 52-60 prov6 NO B -57 -1030 8-13 6059.09
10 M 61- prov8 NO B 58- -1030 17-21 771.97
/* Dataset per modelli con dati raggruppati */ proc means data = danni nway noprint; class sesso capoluogo bendie prov eta potf potkil massa; var danno; output out = dannicum sum = dannocum; run; data dannicum; set dannicum; dannocummed = dannocum / _FREQ_; rename _FREQ_ = nsin; drop _TYPE_; run; proc print data = dannicum (obs = 10); run;
SAS Output
Obs Sesso Capoluogo Bendie Prov Eta potf Potkil Massa nsin dannocum dannocummed
1 F NO B prov1-3 18-22 8-13 -57 -1030 46 128088.48 2784.53
2 F NO B prov1-3 18-22 8-13 58- -1030 1 987.41 987.41
3 F NO B prov1-3 18-22 14-15 -57 -1030 16 54461.79 3403.86
4 F NO B prov1-3 18-22 14-15 58- -1030 2 2441.95 1220.97
5 F NO B prov1-3 18-22 16 -57 -1030 2 4372.42 2186.21
6 F NO B prov1-3 18-22 16 58- -1030 1 10322.89 10322.89
7 F NO B prov1-3 18-22 17-21 -57 1031-1379 1 556.54 556.54
8 F NO B prov1-3 18-22 17-21 58- 1031-1379 2 3551.08 1775.54
9 F NO B prov1-3 23-26 8-13 -57 -1030 62 151011.33 2435.67
10 F NO B prov1-3 23-26 14-15 -57 -1030 26 33844.04 1301.69
/* Il dataset dannicum ha 2 249 righe */ proc summary data = dannicum; output out = conta_righe; run; proc print data = conta_righe; run;
SAS Output
Obs _TYPE_ _FREQ_
1 0 2249

3.A.2.1 Modello Gamma

/* Modello con dati individuali */ proc genmod data = danni; class eta(ref='31-43') potkil bendie capoluogo prov(ref='prov1-3'); model danno = eta potkil bendie capoluogo prov / dist = gamma link = log type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.DANNI
Distribution Gamma
Link Function Log
Dependent Variable danno
Number of Observations Read 12691
Number of Observations Used 12691
Class Level Information
Class Levels Values
Eta 7 18-22 23-26 27-30 44-51 52-60 61- 31-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 9 prov10-12 prov11 prov2-9 prov4 prov5 prov6 prov7 prov8 prov1-3
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 13E3 17803.3419 1.4048
Scaled Deviance 13E3 14967.0467 1.1810
Pearson Chi-Square 13E3 114315.2165 9.0204
Scaled Pearson X2 13E3 96103.3714 7.5833
Log Likelihood   -113894.6875  
Full Log Likelihood   -113894.6875  
AIC (smaller is better)   227827.3751  
AICC (smaller is better)   227827.4350  
BIC (smaller is better)   227968.8994  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 7.8570 0.0436 7.7715 7.9425 32459.9 <.0001
Eta 18-22 1 0.2319 0.0386 0.1563 0.3075 36.13 <.0001
Eta 23-26 1 0.1630 0.0341 0.0961 0.2299 22.82 <.0001
Eta 27-30 1 0.1060 0.0355 0.0364 0.1757 8.90 0.0028
Eta 44-51 1 -0.1213 0.0307 -0.1815 -0.0610 15.57 <.0001
Eta 52-60 1 -0.0216 0.0317 -0.0838 0.0405 0.47 0.4950
Eta 61- 1 -0.0662 0.0341 -0.1329 0.0006 3.77 0.0522
Eta 31-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.2019 0.0208 -0.2427 -0.1611 94.08 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 0.1309 0.0315 0.0691 0.1927 17.24 <.0001
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 0.1143 0.0237 0.0678 0.1607 23.23 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10-12 1 0.2506 0.0480 0.1565 0.3446 27.25 <.0001
Prov prov11 1 -0.2226 0.0502 -0.3209 -0.1243 19.68 <.0001
Prov prov2-9 1 -0.1788 0.0427 -0.2625 -0.0951 17.54 <.0001
Prov prov4 1 0.1136 0.0337 0.0476 0.1796 11.37 0.0007
Prov prov5 1 0.1024 0.0335 0.0368 0.1680 9.35 0.0022
Prov prov6 1 0.2153 0.0354 0.1460 0.2846 37.09 <.0001
Prov prov7 1 0.0076 0.0443 -0.0792 0.0944 0.03 0.8633
Prov prov8 1 -0.0222 0.0308 -0.0826 0.0382 0.52 0.4713
Prov prov1-3 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   1 0.8407 0.0091 0.8229 0.8588    

Note:The scale parameter was estimated by maximum likelihood.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 6 123.98 <.0001
Potkil 1 95.58 <.0001
Bendie 1 16.69 <.0001
Capoluogo 1 22.78 <.0001
Prov 8 141.13 <.0001
/* Modello con dati raggruppati */ proc genmod data = dannicum; class eta(ref='31-43') potkil bendie capoluogo prov(ref='prov1-3'); model dannocummed = eta potkil bendie capoluogo prov / dist = gamma link = log type3; weight nsin; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.DANNICUM
Distribution Gamma
Link Function Log
Dependent Variable dannocummed
Scale Weight Variable nsin
Number of Observations Read 2249
Number of Observations Used 2249
Sum of Weights 12691
Class Level Information
Class Levels Values
Eta 7 18-22 23-26 27-30 44-51 52-60 61- 31-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 9 prov10-12 prov11 prov2-9 prov4 prov5 prov6 prov7 prov8 prov1-3
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 2231 5247.0680 2.3519
Scaled Deviance 2231 2607.1966 1.1686
Pearson Chi-Square 2231 14042.0724 6.2941
Scaled Pearson X2 2231 6977.3144 3.1274
Log Likelihood   -20173.9912  
Full Log Likelihood   -20173.9912  
AIC (smaller is better)   40385.9824  
AICC (smaller is better)   40386.3234  
BIC (smaller is better)   40494.6290  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 7.8570 0.0567 7.7458 7.9682 19185.3 <.0001
Eta 18-22 1 0.2319 0.0502 0.1335 0.3302 21.35 <.0001
Eta 23-26 1 0.1630 0.0444 0.0760 0.2500 13.49 0.0002
Eta 27-30 1 0.1060 0.0462 0.0154 0.1967 5.26 0.0218
Eta 44-51 1 -0.1213 0.0400 -0.1996 -0.0429 9.20 0.0024
Eta 52-60 1 -0.0216 0.0413 -0.1025 0.0592 0.28 0.5999
Eta 61- 1 -0.0662 0.0443 -0.1530 0.0207 2.23 0.1355
Eta 31-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.2019 0.0271 -0.2550 -0.1489 55.61 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 0.1309 0.0410 0.0505 0.2113 10.19 0.0014
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 0.1143 0.0308 0.0538 0.1747 13.73 0.0002
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10-12 1 0.2506 0.0624 0.1282 0.3729 16.11 <.0001
Prov prov11 1 -0.2226 0.0653 -0.3505 -0.0947 11.63 0.0006
Prov prov2-9 1 -0.1788 0.0555 -0.2877 -0.0700 10.36 0.0013
Prov prov4 1 0.1136 0.0438 0.0277 0.1994 6.72 0.0095
Prov prov5 1 0.1024 0.0436 0.0170 0.1878 5.53 0.0187
Prov prov6 1 0.2153 0.0460 0.1252 0.3055 21.92 <.0001
Prov prov7 1 0.0076 0.0576 -0.1053 0.1206 0.02 0.8947
Prov prov8 1 -0.0222 0.0401 -0.1008 0.0564 0.31 0.5797
Prov prov1-3 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   1 0.4969 0.0131 0.4719 0.5232    

Note:The scale parameter was estimated by maximum likelihood.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 6 72.63 <.0001
Potkil 1 56.11 <.0001
Bendie 1 9.85 0.0017
Capoluogo 1 13.44 0.0002
Prov 8 82.57 <.0001
/* Testo accorpamenti eta */ ods select contrasts; proc genmod data = dannicum; class eta(ref='31-43') potkil bendie capoluogo prov(ref='prov1-3'); model dannocummed = eta potkil bendie capoluogo prov / dist = gamma link = log type3; weight nsin; contrast "eta" eta 1 -1 0 0 0 0 0, /* 18-22 con 23-26 */ eta 0 0 1 0 0 0 -1, /* 27-30 con 31-43 */ eta 0 0 0 1 -1 0 0, /* 44-51 con 52-60 */ eta 0 0 0 0 1 -1 0; /* 52-60 con 61- */ run;
SAS Output

The GENMOD Procedure

Contrast Results
Contrast DF Chi-Square Pr > ChiSq Type
eta 4 11.63 0.0203 LR
/* Ulteriori accorpamenti di variabili */ /* eta */ proc format; value classeta low-26 = "18-26" 27-43 = "27-43" 44-high = "44-"; run; proc print data = polizze (obs = 10); run;
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf espo nsin dannotot freqsin lnespo
1 F 27-43 prov8 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
2 M 27-43 prov5 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
3 M 44- prov7 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
4 F 18-26 prov10-12 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
5 M 44- prov2-9 NO B -57 -1030 8-13 0.20000 0 0.000 0 -1.60944
6 F 44- prov8 NO B -57 -1030 14-15 1.00000 0 0.000 0 0.00000
7 M 27-43 prov1-3 NO D -57 1031-1379 17-21 1.00000 0 0.000 0 0.00000
8 M 44- prov1-3 SI B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
9 F 44- prov1-3 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
10 M 44- prov1-3 NO B 58- 1031-1379 17-21 1.00000 1 359.057 1 0.00000
proc genmod data = dannicum; class eta(ref='27-43') potkil bendie capoluogo prov(ref='prov1-3'); model dannocummed = eta potkil bendie capoluogo prov / dist = gamma link = log type3; weight nsin; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.DANNICUM
Distribution Gamma
Link Function Log
Dependent Variable dannocummed
Scale Weight Variable nsin
Number of Observations Read 2249
Number of Observations Used 2249
Sum of Weights 12691
Class Level Information
Class Levels Values
Eta 3 18-26 44- 27-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 9 prov10-12 prov11 prov2-9 prov4 prov5 prov6 prov7 prov8 prov1-3
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 2235 5270.5175 2.3582
Scaled Deviance 2235 2608.3318 1.1670
Pearson Chi-Square 2235 14183.7232 6.3462
Scaled Pearson X2 2235 7019.3974 3.1407
Log Likelihood   -20179.8054  
Full Log Likelihood   -20179.8054  
AIC (smaller is better)   40389.6107  
AICC (smaller is better)   40389.8257  
BIC (smaller is better)   40475.3844  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 7.8888 0.0554 7.7803 7.9973 20292.3 <.0001
Eta 18-26 1 0.1602 0.0351 0.0915 0.2290 20.87 <.0001
Eta 44- 1 -0.1030 0.0286 -0.1589 -0.0470 13.00 0.0003
Eta 27-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.2030 0.0269 -0.2558 -0.1502 56.84 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 0.1303 0.0411 0.0498 0.2109 10.06 0.0015
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 0.1183 0.0308 0.0579 0.1787 14.72 0.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov10-12 1 0.2544 0.0625 0.1320 0.3769 16.58 <.0001
Prov prov11 1 -0.2284 0.0653 -0.3564 -0.1004 12.23 0.0005
Prov prov2-9 1 -0.1774 0.0555 -0.2862 -0.0685 10.20 0.0014
Prov prov4 1 0.1049 0.0438 0.0190 0.1907 5.73 0.0167
Prov prov5 1 0.0992 0.0435 0.0139 0.1844 5.20 0.0226
Prov prov6 1 0.2181 0.0459 0.1281 0.3082 22.55 <.0001
Prov prov7 1 0.0079 0.0577 -0.1051 0.1210 0.02 0.8907
Prov prov8 1 -0.0251 0.0400 -0.1035 0.0533 0.39 0.5303
Prov prov1-3 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   1 0.4949 0.0130 0.4700 0.5211    

Note:The scale parameter was estimated by maximum likelihood.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 2 61.00 <.0001
Potkil 1 57.39 <.0001
Bendie 1 9.73 0.0018
Capoluogo 1 14.40 0.0001
Prov 8 83.49 <.0001
/* Test per accorpamenti province */ ods select contrasts; proc genmod data = dannicum; class eta(ref='27-43') potkil bendie capoluogo prov(ref='prov1-3'); model dannocummed = eta potkil bendie capoluogo prov / dist = gamma link = log; weight nsin; contrasts "province" prov 0 0 0 0 0 0 1 0 -1, /* prov8 con prov1-3 */ prov 0 0 0 0 0 0 0 1 -1, /* prov7 con prov1-3 */ prov 0 0 0 1 -1 0 0 0 0, /* prov4 con prov5 */ prov 1 0 0 0 0 -1 0 0 0, /* prov6 con prov10-12 */ prov 0 1 -1 0 0 0 0 0 0; /* prov11 con prov2-9 */ run;
SAS Output

The GENMOD Procedure

Contrast Results
Contrast DF Chi-Square Pr > ChiSq Type
province 5 1.23 0.9424 LR
/* prov */ proc format; value $classprov "RC","VT","CN","OR","RA","VC","FE","LC","SS","VV","BZ","PV","RG","CH","PG","AR","TE","TN","VR","EN","NO","SV","VI","MC","MT","RE","BS","RI","AG","AV","PC","LE","RN","AN","MS","BO","GE","TS","CB","FI","NU","PE","TO","MI" = "prov1-3-7-8" "BN","PO","IM","BA","PT","TA","SP","CA","ROMA","PA","AO","NA","CE","KR" = "prov2-9-11" "AL","SO","GO","LT","PR","PN","GR","UD","TV","PD","SI","TR","AP","LO","FG","ME","LU","CZ","FR","CT","VE","BG","IS","MO","TP" = "prov4-5" "CL","PI","VA","BR","FO","LI","SR","CO","SA","BL","PZ","BI","CR","CS","AT","MN","PS","AQ","RSM","VB","RO" = "prov6-10-12" run; proc print data = polizze (obs = 10); run;
SAS Output
Obs Sesso Eta Prov Capoluogo Bendie Potkil Massa potf espo nsin dannotot freqsin lnespo
1 F 27-43 prov1-3-7-8 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
2 M 27-43 prov4-5 NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
3 M 44- prov1-3-7-8 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
4 F 18-26 prov6-10-12 run NO B -57 -1030 8-13 1.00000 0 0.000 0 0.00000
5 M 44- prov2-9-11 NO B -57 -1030 8-13 0.20000 0 0.000 0 -1.60944
6 F 44- prov1-3-7-8 NO B -57 -1030 14-15 1.00000 0 0.000 0 0.00000
7 M 27-43 prov1-3-7-8 NO D -57 1031-1379 17-21 1.00000 0 0.000 0 0.00000
8 M 44- prov1-3-7-8 SI B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
9 F 44- prov1-3-7-8 NO B 58- -1030 14-15 1.00000 0 0.000 0 0.00000
10 M 44- prov1-3-7-8 NO B 58- 1031-1379 17-21 1.00000 1 359.057 1 0.00000
proc genmod data = dannicum plots = stdreschi(xbeta); class eta(ref='27-43') potkil bendie capoluogo prov(ref='prov1-3-7-8'); model dannocummed = eta potkil bendie capoluogo prov / dist = gamma link = log type3; weight nsin; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.DANNICUM
Distribution Gamma
Link Function Log
Dependent Variable dannocummed
Scale Weight Variable nsin
Number of Observations Read 2249
Number of Observations Used 2249
Sum of Weights 12691
Class Level Information
Class Levels Values
Eta 3 18-26 44- 27-43
Potkil 2 -57 58-
Bendie 2 B D
Capoluogo 2 NO SI
Prov 4 prov2-9-11 prov4-5 prov6-10-12 run prov1-3-7-8
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 2240 5272.9949 2.3540
Scaled Deviance 2240 2608.4516 1.1645
Pearson Chi-Square 2240 14116.3074 6.3019
Scaled Pearson X2 2240 6983.0724 3.1174
Log Likelihood   -20180.4183  
Full Log Likelihood   -20180.4183  
AIC (smaller is better)   40380.8365  
AICC (smaller is better)   40380.9348  
BIC (smaller is better)   40438.0189  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 7.8775 0.0518 7.7760 7.9790 23119.8 <.0001
Eta 18-26 1 0.1592 0.0351 0.0905 0.2279 20.61 <.0001
Eta 44- 1 -0.1031 0.0285 -0.1590 -0.0472 13.07 0.0003
Eta 27-43 0 0.0000 0.0000 0.0000 0.0000 . .
Potkil -57 1 -0.2028 0.0269 -0.2555 -0.1500 56.78 <.0001
Potkil 58- 0 0.0000 0.0000 0.0000 0.0000 . .
Bendie B 1 0.1324 0.0409 0.0522 0.2125 10.46 0.0012
Bendie D 0 0.0000 0.0000 0.0000 0.0000 . .
Capoluogo NO 1 0.1209 0.0305 0.0610 0.1807 15.65 <.0001
Capoluogo SI 0 0.0000 0.0000 0.0000 0.0000 . .
Prov prov2-9-11 1 -0.1897 0.0425 -0.2729 -0.1064 19.92 <.0001
Prov prov4-5 1 0.1095 0.0312 0.0484 0.1707 12.33 0.0004
Prov prov6-10-12 run 1 0.2369 0.0369 0.1645 0.3093 41.12 <.0001
Prov prov1-3-7-8 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   1 0.4947 0.0130 0.4698 0.5209    

Note:The scale parameter was estimated by maximum likelihood.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
Eta 2 60.76 <.0001
Potkil 1 57.34 <.0001
Bendie 1 10.11 0.0015
Capoluogo 1 15.29 <.0001
Prov 3 82.27 <.0001

The GENMOD Procedure

Plot of Deviance Residual by Linear Predictor

4) Riservazione con i GLM

Preparazione dei dati

data runoff; set dati.runoff; run; proc print data = runoff (obs = 10); run;
SAS Output
Obs pagamenti nden annoacc annodiff annopag
1 10775462 32165 0 0 0
2 9159050 32165 0 1 1
3 2581795 32165 0 2 2
4 1380284 32165 0 3 3
5 871723 32165 0 4 4
6 589888 32165 0 5 5
7 1275556 32165 0 6 6
8 1643537 32165 0 7 7
9 522288 32165 0 8 8
10 645271 32165 0 9 9
/* Riporto: - pagamentinden: pagamenti incrementali in rapporto al numero di sinistri denunciati - logpagamenti: logaritmo dei pagamenti */ data runoff1; set runoff; pagamentinden = pagamenti / nden; logpagamenti = log(pagamenti); run; proc print data = runoff1 (obs = 10); run;
SAS Output
Obs pagamenti nden annoacc annodiff annopag pagamentinden logpagamenti
1 10775462 32165 0 0 0 335.006 16.1928
2 9159050 32165 0 1 1 284.752 16.0303
3 2581795 32165 0 2 2 80.267 14.7640
4 1380284 32165 0 3 3 42.913 14.1378
5 871723 32165 0 4 4 27.102 13.6782
6 589888 32165 0 5 5 18.339 13.2877
7 1275556 32165 0 6 6 39.657 14.0589
8 1643537 32165 0 7 7 51.097 14.3124
9 522288 32165 0 8 8 16.238 13.1660
10 645271 32165 0 9 9 20.061 13.3774

Modello Poisson-Logaritmo

proc genmod data = runoff1; class annoacc (ref = first) annodiff (ref = first); model pagamenti = annoacc annodiff / dist = poisson link = log type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.RUNOFF1  
Distribution Poisson  
Link Function Log  
Dependent Variable pagamenti pagamenti
Number of Observations Read 105
Number of Observations Used 105
Class Level Information
Class Levels Values
annoacc 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
annodiff 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 78 14260424.598 182825.9564
Scaled Deviance 78 14260424.598 182825.9564
Pearson Chi-Square 78 14447110.935 185219.3710
Scaled Pearson X2 78 14447110.935 185219.3710
Log Likelihood   9218270255.4  
Full Log Likelihood   -7131082.019  
AIC (smaller is better)   14262218.039  
AICC (smaller is better)   14262237.675  
BIC (smaller is better)   14262289.696  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 16.1578 0.0002 16.1574 16.1581 7.225E9 <.0001
annoacc 1 1 0.1685 0.0002 0.1681 0.1690 473998 <.0001
annoacc 2 1 0.3099 0.0002 0.3095 0.3104 1688300 <.0001
annoacc 3 1 0.1911 0.0002 0.1906 0.1916 605889 <.0001
annoacc 4 1 0.2646 0.0002 0.2641 0.2650 1191696 <.0001
annoacc 5 1 0.4359 0.0002 0.4354 0.4364 3451576 <.0001
annoacc 6 1 0.5303 0.0002 0.5299 0.5308 5257320 <.0001
annoacc 7 1 0.5360 0.0002 0.5355 0.5364 5290452 <.0001
annoacc 8 1 0.6910 0.0002 0.6906 0.6915 9217844 <.0001
annoacc 9 1 0.7318 0.0002 0.7314 0.7323 1.034E7 <.0001
annoacc 10 1 0.8491 0.0002 0.8487 0.8496 1.427E7 <.0001
annoacc 11 1 0.7718 0.0002 0.7713 0.7722 1.114E7 <.0001
annoacc 12 1 0.7203 0.0002 0.7198 0.7207 8877816 <.0001
annoacc 13 1 0.7465 0.0003 0.7460 0.7471 6821783 <.0001
annoacc 0 0 0.0000 0.0000 0.0000 0.0000 . .
annodiff 1 1 -0.0887 0.0001 -0.0889 -0.0886 847441 <.0001
annodiff 2 1 -1.1171 0.0001 -1.1173 -1.1168 6.342E7 <.0001
annodiff 3 1 -1.7941 0.0002 -1.7945 -1.7937 8.443E7 <.0001
annodiff 4 1 -2.3215 0.0003 -2.3220 -2.3209 7.675E7 <.0001
annodiff 5 1 -2.3994 0.0003 -2.4000 -2.3988 6.61E7 <.0001
annodiff 6 1 -2.7240 0.0004 -2.7247 -2.7232 5.33E7 <.0001
annodiff 7 1 -2.2936 0.0003 -2.2942 -2.2929 4.818E7 <.0001
annodiff 8 1 -3.0068 0.0005 -3.0078 -3.0058 3.435E7 <.0001
annodiff 9 1 -3.2233 0.0006 -3.2246 -3.2221 2.552E7 <.0001
annodiff 10 1 -3.3294 0.0008 -3.3309 -3.3279 1.93E7 <.0001
annodiff 11 1 -3.6627 0.0010 -3.6647 -3.6607 1.255E7 <.0001
annodiff 12 1 -3.1271 0.0010 -3.1291 -3.1251 9564465 <.0001
annodiff 13 1 -2.3422 0.0010 -2.3442 -2.3402 5294849 <.0001
annodiff 0 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 1.0000 0.0000 1.0000 1.0000    

Note:The scale parameter was held fixed.

LR Statistics For Type 3 Analysis
Source DF Chi-Square Pr > ChiSq
annoacc 13 3.667E7 <.0001
annodiff 13 4.948E8 <.0001

Modello Gamma-Logaritmo

proc genmod data = runoff1; class annoacc (ref = first) annodiff (ref = first); model pagamenti = annoacc annodiff / dist = gamma link = log scale = pearson type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.RUNOFF1  
Distribution Gamma  
Link Function Log  
Dependent Variable pagamenti pagamenti
Number of Observations Read 105
Number of Observations Used 105
Class Level Information
Class Levels Values
annoacc 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
annodiff 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 78 9.9323 0.1273
Scaled Deviance 78 88.4751 1.1343
Pearson Chi-Square 78 8.7563 0.1123
Scaled Pearson X2 78 78.0000 1.0000
Log Likelihood   -1573.3582  
Full Log Likelihood   -1573.3582  
AIC (smaller is better)   3200.7164  
AICC (smaller is better)   3220.3528  
BIC (smaller is better)   3272.3733  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 16.3646 0.1400 16.0903 16.6390 13666.4 <.0001
annoacc 1 1 0.2396 0.1320 -0.0191 0.4983 3.29 0.0695
annoacc 2 1 0.2364 0.1377 -0.0334 0.5062 2.95 0.0859
annoacc 3 1 -0.0378 0.1415 -0.3151 0.2395 0.07 0.7893
annoacc 4 1 -0.0195 0.1477 -0.3091 0.2700 0.02 0.8947
annoacc 5 1 0.1012 0.1534 -0.1995 0.4020 0.44 0.5095
annoacc 6 1 0.1889 0.1590 -0.1227 0.5005 1.41 0.2348
annoacc 7 1 0.3370 0.1657 0.0122 0.6617 4.14 0.0420
annoacc 8 1 0.4124 0.1759 0.0677 0.7572 5.50 0.0190
annoacc 9 1 0.4317 0.1873 0.0646 0.7988 5.31 0.0212
annoacc 10 1 0.6940 0.2032 0.2959 1.0922 11.67 0.0006
annoacc 11 1 0.6255 0.2270 0.1806 1.0704 7.59 0.0059
annoacc 12 1 0.5253 0.2675 0.0009 1.0496 3.85 0.0496
annoacc 13 1 0.5396 0.3631 -0.1721 1.2513 2.21 0.1372
annoacc 0 0 0.0000 0.0000 0.0000 0.0000 . .
annodiff 1 1 -0.1047 0.1315 -0.3625 0.1530 0.63 0.4258
annodiff 2 1 -1.1463 0.1355 -1.4119 -0.8808 71.57 <.0001
annodiff 3 1 -1.7918 0.1395 -2.0653 -1.5183 164.87 <.0001
annodiff 4 1 -2.2928 0.1438 -2.5747 -2.0109 254.07 <.0001
annodiff 5 1 -2.4195 0.1498 -2.7131 -2.1259 260.93 <.0001
annodiff 6 1 -2.7622 0.1560 -3.0679 -2.4564 313.52 <.0001
annodiff 7 1 -2.3163 0.1632 -2.6362 -1.9965 201.46 <.0001
annodiff 8 1 -3.0787 0.1727 -3.4171 -2.7403 317.93 <.0001
annodiff 9 1 -3.3611 0.1859 -3.7255 -2.9966 326.74 <.0001
annodiff 10 1 -3.4670 0.2027 -3.8644 -3.0697 292.44 <.0001
annodiff 11 1 -3.8490 0.2256 -4.2911 -3.4069 291.13 <.0001
annodiff 12 1 -3.3855 0.2673 -3.9093 -2.8616 160.41 <.0001
annodiff 13 1 -2.5491 0.3631 -3.2608 -1.8374 49.28 <.0001
annodiff 0 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 8.9078 0.0000 8.9078 8.9078    

Note:The Gamma scale parameter was estimated by DOF/Pearson's Chi-Square

Lagrange Multiplier Statistics
Parameter Chi-Square Pr > ChiSq
Scale 1.5689 0.2104
LR Statistics For Type 3 Analysis
Source Num DF Den DF F Value Pr > F Chi-Square Pr > ChiSq
annoacc 13 78 2.52 0.0061 32.80 0.0018
annodiff 13 78 84.19 <.0001 1094.46 <.0001

Modello di Poisson con Sovradispersione-Logaritmo

proc genmod data = runoff1; class annoacc (ref = first) annodiff (ref = first); model pagamenti = annoacc annodiff / dist = poisson link = log scale = pearson type3; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.RUNOFF1  
Distribution Poisson  
Link Function Log  
Dependent Variable pagamenti pagamenti
Number of Observations Read 105
Number of Observations Used 105
Class Level Information
Class Levels Values
annoacc 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
annodiff 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 78 14260424.598 182825.9564
Scaled Deviance 78 76.9921 0.9871
Pearson Chi-Square 78 14447110.935 185219.3710
Scaled Pearson X2 78 78.0000 1.0000
Log Likelihood   49769.4718  
Full Log Likelihood   -7131082.019  
AIC (smaller is better)   14262218.039  
AICC (smaller is better)   14262237.675  
BIC (smaller is better)   14262289.696  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 16.1578 0.0818 15.9974 16.3181 39008.2 <.0001
annoacc 1 1 0.1685 0.1054 -0.0380 0.3750 2.56 0.1097
annoacc 2 1 0.3099 0.1027 0.1087 0.5111 9.12 0.0025
annoacc 3 1 0.1911 0.1057 -0.0160 0.3982 3.27 0.0705
annoacc 4 1 0.2646 0.1043 0.0601 0.4690 6.43 0.0112
annoacc 5 1 0.4359 0.1010 0.2380 0.6338 18.64 <.0001
annoacc 6 1 0.5303 0.0995 0.3352 0.7254 28.38 <.0001
annoacc 7 1 0.5360 0.1003 0.3394 0.7325 28.56 <.0001
annoacc 8 1 0.6910 0.0980 0.4990 0.8830 49.77 <.0001
annoacc 9 1 0.7318 0.0980 0.5398 0.9238 55.81 <.0001
annoacc 10 1 0.8491 0.0968 0.6595 1.0387 77.02 <.0001
annoacc 11 1 0.7718 0.0995 0.5767 0.9668 60.16 <.0001
annoacc 12 1 0.7203 0.1040 0.5164 0.9242 47.93 <.0001
annoacc 13 1 0.7465 0.1230 0.5054 0.9876 36.83 <.0001
annoacc 0 0 0.0000 0.0000 0.0000 0.0000 . .
annodiff 1 1 -0.0887 0.0415 -0.1701 -0.0074 4.58 0.0324
annodiff 2 1 -1.1171 0.0604 -1.2354 -0.9987 342.42 <.0001
annodiff 3 1 -1.7941 0.0840 -1.9588 -1.6294 455.86 <.0001
annodiff 4 1 -2.3215 0.1140 -2.5450 -2.0979 414.38 <.0001
annodiff 5 1 -2.3994 0.1270 -2.6484 -2.1505 356.89 <.0001
annodiff 6 1 -2.7240 0.1606 -3.0387 -2.4093 287.77 <.0001
annodiff 7 1 -2.2936 0.1422 -2.5723 -2.0149 260.13 <.0001
annodiff 8 1 -3.0068 0.2208 -3.4396 -2.5741 185.47 <.0001
annodiff 9 1 -3.2233 0.2746 -3.7615 -2.6852 137.81 <.0001
annodiff 10 1 -3.3294 0.3262 -3.9687 -2.6901 104.19 <.0001
annodiff 11 1 -3.6627 0.4449 -4.5347 -2.7907 67.78 <.0001
annodiff 12 1 -3.1271 0.4352 -3.9800 -2.2742 51.64 <.0001
annodiff 13 1 -2.3422 0.4381 -3.2008 -1.4836 28.59 <.0001
annodiff 0 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 430.3712 0.0000 430.3712 430.3712    

Note:The scale parameter was estimated by the square root of Pearson's Chi-Square/DOF.

LR Statistics For Type 3 Analysis
Source Num DF Den DF F Value Pr > F Chi-Square Pr > ChiSq
annoacc 13 78 15.23 <.0001 198.00 <.0001
annodiff 13 78 205.48 <.0001 2671.22 <.0001

Modello di Poisson con Sovradispersione-Logaritmo per pagamenti rapportati a una misura di esposizione

proc genmod data = runoff1; class annoacc (ref = first) annodiff (ref = first); model pagamentinden = annoacc annodiff / dist = poisson link = log scale = pearson type3; weight nden; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.RUNOFF1  
Distribution Poisson  
Link Function Log  
Dependent Variable pagamentinden  
Scale Weight Variable nden nden
Number of Observations Read 105
Number of Observations Used 105
Sum of Weights 3019776
Class Level Information
Class Levels Values
annoacc 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
annodiff 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 78 14260424.598 182825.9564
Scaled Deviance 78 76.9921 0.9871
Pearson Chi-Square 78 14447110.935 185219.3710
Scaled Pearson X2 78 78.0000 1.0000
Log Likelihood   16546.6067  
Full Log Likelihood   -16497154.04  
AIC (smaller is better)   32994362.072  
AICC (smaller is better)   32994381.708  
BIC (smaller is better)   32994433.729  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 5.7791 0.0818 5.6188 5.9395 4990.20 <.0001
annoacc 1 1 0.1776 0.1054 -0.0289 0.3841 2.84 0.0919
annoacc 2 1 0.3268 0.1027 0.1256 0.5280 10.14 0.0015
annoacc 3 1 0.2943 0.1057 0.0872 0.5014 7.76 0.0053
annoacc 4 1 0.3942 0.1043 0.1897 0.5986 14.28 0.0002
annoacc 5 1 0.5141 0.1010 0.3162 0.7120 25.92 <.0001
annoacc 6 1 0.5967 0.0995 0.4016 0.7918 35.94 <.0001
annoacc 7 1 0.6257 0.1003 0.4292 0.8223 38.93 <.0001
annoacc 8 1 1.0454 0.0980 0.8534 1.2374 113.90 <.0001
annoacc 9 1 1.0019 0.0980 0.8099 1.1939 104.60 <.0001
annoacc 10 1 1.2260 0.0968 1.0364 1.4156 160.57 <.0001
annoacc 11 1 1.2347 0.0995 1.0397 1.4297 153.98 <.0001
annoacc 12 1 1.3203 0.1040 1.1164 1.5242 161.06 <.0001
annoacc 13 1 1.3778 0.1230 1.1368 1.6189 125.47 <.0001
annoacc 0 0 0.0000 0.0000 0.0000 0.0000 . .
annodiff 1 1 -0.0887 0.0415 -0.1701 -0.0074 4.58 0.0324
annodiff 2 1 -1.1171 0.0604 -1.2354 -0.9987 342.42 <.0001
annodiff 3 1 -1.7941 0.0840 -1.9588 -1.6294 455.86 <.0001
annodiff 4 1 -2.3215 0.1140 -2.5450 -2.0979 414.38 <.0001
annodiff 5 1 -2.3994 0.1270 -2.6484 -2.1505 356.89 <.0001
annodiff 6 1 -2.7240 0.1606 -3.0387 -2.4093 287.77 <.0001
annodiff 7 1 -2.2936 0.1422 -2.5723 -2.0149 260.13 <.0001
annodiff 8 1 -3.0068 0.2208 -3.4396 -2.5741 185.47 <.0001
annodiff 9 1 -3.2233 0.2746 -3.7615 -2.6852 137.81 <.0001
annodiff 10 1 -3.3294 0.3262 -3.9687 -2.6901 104.19 <.0001
annodiff 11 1 -3.6627 0.4449 -4.5347 -2.7907 67.78 <.0001
annodiff 12 1 -3.1271 0.4352 -3.9800 -2.2742 51.64 <.0001
annodiff 13 1 -2.3422 0.4381 -3.2008 -1.4836 28.59 <.0001
annodiff 0 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 430.3712 0.0000 430.3712 430.3712    

Note:The scale parameter was estimated by the square root of Pearson's Chi-Square/DOF.

LR Statistics For Type 3 Analysis
Source Num DF Den DF F Value Pr > F Chi-Square Pr > ChiSq
annoacc 13 78 42.02 <.0001 546.21 <.0001
annodiff 13 78 205.48 <.0001 2671.22 <.0001

Modello di Poisson-Composto-Logaritmo per pagamenti rapportati a una misura di esposizione

proc genmod data = runoff1; class annoacc (ref = first) annodiff (ref = first); csi = 1.01887; y = _RESP_; mu = _MEAN_; variance var = mu*csi; if y = 0 then d = 2 * mu**(2 - csi) / (2 - csi); else d = -2 * (y * (mu**(1 - csi) - y**(1 - csi)) / (1 - csi) - (mu**(2 - csi) - y**(2 - csi)) / (2 - csi)); deviance dev = d; model pagamentinden = annoacc annodiff / link = log scale = pearson type3; weight nden; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.RUNOFF1  
Distribution User  
Link Function Log  
Dependent Variable pagamentinden  
Scale Weight Variable nden nden
Number of Observations Read 105
Number of Observations Used 105
Sum of Weights 3019776
Class Level Information
Class Levels Values
annoacc 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
annodiff 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 78 13163753.882 168766.0754
Scaled Deviance 78 72.4134 0.9284
Pearson Chi-Square 78 14179315.033 181786.0902
Scaled Pearson X2 78 78.0000 1.0000
Log Likelihood   -36.2067  
Full Log Likelihood   -36.2067  
AIC (smaller is better)   126.4134  
AICC (smaller is better)   146.0498  
BIC (smaller is better)   198.0704  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 5.7791 0.0818 5.6188 5.9395 4990.30 <.0001
annoacc 1 1 0.1776 0.1054 -0.0289 0.3841 2.84 0.0919
annoacc 2 1 0.3268 0.1027 0.1256 0.5280 10.14 0.0015
annoacc 3 1 0.2943 0.1057 0.0872 0.5014 7.76 0.0053
annoacc 4 1 0.3942 0.1043 0.1897 0.5986 14.28 0.0002
annoacc 5 1 0.5141 0.1010 0.3162 0.7120 25.92 <.0001
annoacc 6 1 0.5967 0.0995 0.4016 0.7918 35.94 <.0001
annoacc 7 1 0.6257 0.1003 0.4292 0.8223 38.94 <.0001
annoacc 8 1 1.0454 0.0980 0.8534 1.2374 113.91 <.0001
annoacc 9 1 1.0019 0.0980 0.8099 1.1939 104.60 <.0001
annoacc 10 1 1.2260 0.0968 1.0364 1.4156 160.57 <.0001
annoacc 11 1 1.2347 0.0995 1.0397 1.4297 153.99 <.0001
annoacc 12 1 1.3203 0.1040 1.1164 1.5242 161.06 <.0001
annoacc 13 1 1.3778 0.1230 1.1368 1.6189 125.47 <.0001
annoacc 0 0 0.0000 0.0000 0.0000 0.0000 . .
annodiff 1 1 -0.0887 0.0415 -0.1701 -0.0074 4.58 0.0324
annodiff 2 1 -1.1171 0.0604 -1.2354 -0.9988 342.42 <.0001
annodiff 3 1 -1.7941 0.0840 -1.9588 -1.6294 455.86 <.0001
annodiff 4 1 -2.3215 0.1140 -2.5450 -2.0979 414.39 <.0001
annodiff 5 1 -2.3994 0.1270 -2.6483 -2.1505 356.89 <.0001
annodiff 6 1 -2.7240 0.1606 -3.0387 -2.4092 287.78 <.0001
annodiff 7 1 -2.2936 0.1422 -2.5723 -2.0149 260.13 <.0001
annodiff 8 1 -3.0068 0.2208 -3.4396 -2.5741 185.47 <.0001
annodiff 9 1 -3.2232 0.2746 -3.7614 -2.6851 137.81 <.0001
annodiff 10 1 -3.3292 0.3261 -3.9684 -2.6900 104.20 <.0001
annodiff 11 1 -3.6627 0.4449 -4.5347 -2.7907 67.78 <.0001
annodiff 12 1 -3.1271 0.4352 -3.9800 -2.2742 51.64 <.0001
annodiff 13 1 -2.3422 0.4381 -3.2008 -1.4836 28.59 <.0001
annodiff 0 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 426.3638 0.0000 426.3638 426.3638    

Note:The scale parameter was estimated by the square root of Pearson's Chi-Square/DOF.

LR Statistics For Type 3 Analysis
Source Num DF Den DF F Value Pr > F Chi-Square Pr > ChiSq
annoacc 13 78 38.02 <.0001 494.31 <.0001
annodiff 13 78 189.80 <.0001 2467.38 <.0001

Modello di Poisson con Sovradispersione-Logaritmo per pagamenti rapportati a una misura di esposizione

proc genmod data = runoff1; class annoacc (ref = first) annodiff (ref = first) annopag; model pagamentinden = annoacc annodiff annopag / dist = poisson link = log scale = pearson type3; weight nden; run;
SAS Output

The GENMOD Procedure

Model Information
Data Set WORK.RUNOFF1  
Distribution Poisson  
Link Function Log  
Dependent Variable pagamentinden  
Scale Weight Variable nden nden
Number of Observations Read 105
Number of Observations Used 105
Sum of Weights 3019776
Class Level Information
Class Levels Values
annoacc 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
annodiff 14 1 2 3 4 5 6 7 8 9 10 11 12 13 0
annopag 14 0 1 2 3 4 5 6 7 8 9 10 11 12 13
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 66 10720784.463 162436.1282
Scaled Deviance 66 66.3551 1.0054
Pearson Chi-Square 66 10663412.571 161566.8571
Scaled Pearson X2 66 66.0000 1.0000
Log Likelihood   18979.8945  
Full Log Likelihood   -14727333.97  
AIC (smaller is better)   29454745.937  
AICC (smaller is better)   29454793.937  
BIC (smaller is better)   29454849.442  
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Parameter   DF Estimate Standard
Error
Wald 95% Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept   1 4.8454 1.0388 2.8094 6.8815 21.76 <.0001
annoacc 1 1 0.2951 0.1395 0.0218 0.5685 4.48 0.0343
annoacc 2 1 0.5029 0.2050 0.1010 0.9048 6.02 0.0142
annoacc 3 1 0.4727 0.2792 -0.0746 1.0200 2.87 0.0905
annoacc 4 1 0.5844 0.3562 -0.1137 1.2825 2.69 0.1009
annoacc 5 1 0.7189 0.4352 -0.1340 1.5718 2.73 0.0985
annoacc 6 1 0.8375 0.5145 -0.1708 1.8459 2.65 0.1035
annoacc 7 1 0.9726 0.5971 -0.1978 2.1430 2.65 0.1034
annoacc 8 1 1.5515 0.6794 0.2199 2.8831 5.21 0.0224
annoacc 9 1 1.6365 0.7632 0.1407 3.1324 4.60 0.0320
annoacc 10 1 1.9659 0.8471 0.3057 3.6261 5.39 0.0203
annoacc 11 1 2.0614 0.9338 0.2312 3.8916 4.87 0.0273
annoacc 12 1 2.2159 1.0013 0.2534 4.1785 4.90 0.0269
annoacc 13 1 2.3115 1.0424 0.2686 4.3545 4.92 0.0266
annoacc 0 0 0.0000 0.0000 0.0000 0.0000 . .
annodiff 1 1 -0.0107 0.0883 -0.1837 0.1623 0.01 0.9035
annodiff 2 1 -0.9643 0.1713 -1.3001 -0.6285 31.68 <.0001
annodiff 3 1 -1.5729 0.2573 -2.0773 -1.0686 37.36 <.0001
annodiff 4 1 -2.0294 0.3463 -2.7082 -1.3507 34.34 <.0001
annodiff 5 1 -2.0365 0.4297 -2.8788 -1.1943 22.46 <.0001
annodiff 6 1 -2.2839 0.5202 -3.3035 -1.2643 19.28 <.0001
annodiff 7 1 -1.7727 0.5968 -2.9425 -0.6029 8.82 0.0030
annodiff 8 1 -2.4041 0.6964 -3.7690 -1.0392 11.92 0.0006
annodiff 9 1 -2.5525 0.7921 -4.1050 -1.0000 10.38 0.0013
annodiff 10 1 -2.5925 0.8877 -4.3324 -0.8526 8.53 0.0035
annodiff 11 1 -2.8695 1.0014 -4.8321 -0.9069 8.21 0.0042
annodiff 12 1 -2.2588 1.0688 -4.3536 -0.1640 4.47 0.0346
annodiff 13 1 -1.4085 1.1139 -3.5916 0.7746 1.60 0.2060
annodiff 0 0 0.0000 0.0000 0.0000 0.0000 . .
annopag 0 1 0.9687 1.0460 -1.0814 3.0189 0.86 0.3544
annopag 1 1 0.7962 0.9600 -1.0853 2.6777 0.69 0.4069
annopag 2 1 0.6252 0.8765 -1.0927 2.3431 0.51 0.4757
annopag 3 1 0.6656 0.7934 -0.8895 2.2207 0.70 0.4016
annopag 4 1 0.6738 0.7101 -0.7181 2.0656 0.90 0.3427
annopag 5 1 0.6838 0.6264 -0.5439 1.9114 1.19 0.2750
annopag 6 1 0.7182 0.5433 -0.3467 1.7831 1.75 0.1862
annopag 7 1 0.6952 0.4604 -0.2072 1.5976 2.28 0.1310
annopag 8 1 0.4907 0.3780 -0.2501 1.2315 1.69 0.1942
annopag 9 1 0.3391 0.2958 -0.2407 0.9190 1.31 0.2516
annopag 10 1 0.2005 0.2142 -0.2192 0.6203 0.88 0.3491
annopag 11 1 0.1177 0.1345 -0.1460 0.3813 0.77 0.3816
annopag 12 0 0.0000 0.0000 0.0000 0.0000 . .
annopag 13 0 0.0000 0.0000 0.0000 0.0000 . .
Scale   0 401.9538 0.0000 401.9538 401.9538    

Note:The scale parameter was estimated by the square root of Pearson's Chi-Square/DOF.

LR Statistics For Type 3 Analysis
Source Num DF Den DF F Value Pr > F Chi-Square Pr > ChiSq
annoacc 12 66 3.79 0.0002 45.53 <.0001
annodiff 12 66 28.48 <.0001 341.81 <.0001
annopag 12 66 1.83 0.0617 21.91 0.0386